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
Agreed that modification of the date/time portion is incorrect, however IMO it shouldn't have the side effect of also changing the timezone. The one specified in the string should determine how to interpret its own date and time, but the DateTime instance's own timezone should be preserved.
The reasoning being that the date/time and the timezone are managed separately in the object - as seen in the var_dump output. After all, if you wanted to use that whole string as the new value then why not just make yourself a brand-new DateTime object instead?
If all php versions would work this way, it won't be a problem.
But if someone has php 8.2.4 and use Carbon library createFromTimeString function (which internally use modify function) this way:
Description
The following code:
Resulted in this output(php >=8.2.5; >=8.3.0):
But I expected this output instead(this works on php 8.2.4, 8.2.3, 8.2.2):
PHP Version
Operating System
Any Linux or Windows
The text was updated successfully, but these errors were encountered: