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
this way your reference DateTimeImmutable object is created against a timestamp (aka) GMT which is not affected by Timezone trickery 😉 .
Maybe refactor your code to always use this code everywhere instead of repeating it everywhere it would make the code more maintainable too. If I'm correct this pattern is used in many places currently.
PS: if you are lazy .. you could even use DateTimeImmutable('@0') as a private static variable 👍 anyway this part should be improved.
The text was updated successfully, but these errors were encountered:
duration-php/src/Duration.php
Line 149 in 67abef8
This method should be improved to guard against DST and other timezone shenanigans...
should be
this way your reference DateTimeImmutable object is created against a timestamp (aka) GMT which is not affected by Timezone trickery 😉 .
Maybe refactor your code to always use this code everywhere instead of repeating it everywhere it would make the code more maintainable too. If I'm correct this pattern is used in many places currently.
PS: if you are lazy .. you could even use
DateTimeImmutable('@0')
as a private static variable 👍 anyway this part should be improved.The text was updated successfully, but these errors were encountered: