-
-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fixed an issue with datetimeimmutable comparaison #180
fixed an issue with datetimeimmutable comparaison #180
Conversation
9e8f9cf
to
efc05a2
Compare
e5e50d2
to
1dcd0e9
Compare
$this->innerDateTime = new parent($time, $timezone); | ||
} | ||
|
||
//switch from regular datetime to safe version | ||
private static function createFromRegular(\DateTimeImmutable $datetime): self | ||
{ | ||
$safeDatetime = new self(); | ||
$safeDatetime = new self($datetime->format('Y-m-d H:i:s'), $datetime->getTimezone()); //we need to also update the wrapper to not break the operators '<' and '>' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about microseconds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
damn i forgot about theses
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So milliseconds can't be used with < 7.4 because ::createFromFormat
doesn't accept it, microseconds should be used.
@Kharhamel thank you for fast response, can we potentially get a patch release with this? |
This pr solves #179