You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Without changing the DEFAULT_TO_STRING_FORMAT, Carbon loses context of the TZ. This results in two different dates being considered different when compared as Carbon objects, but equal when comparing as strings.
Thanks!
The text was updated successfully, but these errors were encountered:
Yes, the default stringification does not include the timezone, so you should format them with timezone included if you want a string comparison including the timezone, not use the implicit cast.
Note that you can also change globally the default method used for implicit string, but it's better to just explicitly format at the place you need to convert date to string.
Hello,
I encountered an issue with the following code:
Carbon version: 3.8.4
PHP version: 8.2.22
I expected to get:
But I actually get:
Without changing the
DEFAULT_TO_STRING_FORMAT
, Carbon loses context of the TZ. This results in two different dates being considered different when compared as Carbon objects, but equal when comparing as strings.Thanks!
The text was updated successfully, but these errors were encountered: