New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"DateTimeMock::__construct()" side-effect using "idate()" when setting microseconds... #7
Comments
Hi! Thanks for your report. Would you be able to open a pull request with the fix and a test for it? |
Sure ;) |
You should first fork the repository and create your own copy, and then open the PR against the main repo, as described here: https://docs.github.com/en/get-started/quickstart/contributing-to-projects hope this helps! |
I've created the PR... |
I just released version 0.2.2 including your contribution. Thanks 🎉 |
Hi,
when using a non GMT DateTimezone and setting microseconds via
the hour/minute is wrongly modified as idate() works on unix GMT-based timestamp.
Example:
Let's assume 02.04.2022 18:00:00 as Berlin time.
DateTime now contains:
date: 2022-04-02 18:00:00.0 Europe/Berlin (+02:00)
Now using
$dt
contains:date: 2022-04-02 16:00:00.0 Europe/Berlin (+02:00)
.This means the time is now set 2 hours back, but still the Europe/Berlin timezone.
Solution in DateTimeMock:
Use
as this does't modify hour/minute/second when setting microseconds...
-mimo
The text was updated successfully, but these errors were encountered: