Comment by tyingq

Comment by tyingq 7 days ago

3 replies

The date treatment isn't great, but the repo seems to indicate it's existed as a public thing for 22 days. So perhaps just an early compromise to get it working.

mdaniel 7 days ago

For all the folks championing how awesome PHP is in this thread, one would surely hope it has rfc3339 aware date parsing, no? But I guess that <https://www.php.net/manual-lookup.php?pattern=rfc%203339&sco...> and <https://www.php.net/manual-lookup.php?pattern=iso8601&scope=...> both being :shruggle: doesn't do it any favors. However, it seems it is just a search stupidity because https://www.php.net/manual/en/datetimeimmutable.createfromfo...

I do love this, since it 100% squares with my mental model of PHP's approach to life: you're holding it wrong https://www.php.net/manual/en/function.date-parse-from-forma...

  • Implicated 7 days ago

    Given the tone and wording of your comments I hesitated to even reply but, alas, my love for PHP was strong enough to push me through.

    You are, actually, doing it wrong.

    https://carbon.nesbot.com/docs/

    I forgive you, being that you're clearly not familiar with modern PHP and it's incredibly mature and diverse library ecosystem and first class package manager.

    > However, it seems it is just a search stupidity ...

    You're searching a list of thirty (30) functions. I don't even know how you found that list of functions but, surely, you don't think that's an exhaustive place to search for a specific date format? Surely you're not being purposely obtuse. (As you likely found, if you just plop your search term in the search at the top of the PHP website you would have found the DateTime class and how to handle these various formats)

    Anyway - for anyone who may happen across this odd chain of comments, dealing with dates in PHP is an actual breeze using Carbon\Carbon.

    • tyingq 7 days ago

      Pretty sure that doesn't handle the 'Z' timezone offset, as I saw the same with various PHP built-ins. Some ignore offsets, some don't...but handle only specific formats and not others, including the Z. So you still need some kind of wrapper.