Skip to content
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

Pseudo-variable now does not work as intended on Linux machines. #432

Open
c-lipka opened this issue Jul 29, 2021 · 1 comment
Open

Pseudo-variable now does not work as intended on Linux machines. #432

c-lipka opened this issue Jul 29, 2021 · 1 comment
Milestone

Comments

@c-lipka
Copy link
Contributor

c-lipka commented Jul 29, 2021

On Linux machines, the value returned by now may be based on local time, instead of UTC as documented and intended.

This is due to an undocumented issue in boost::posix_time::microsec_clock::universal_time().

c-lipka added a commit to c-lipka/povray that referenced this issue Jul 29, 2021
To work around Boost's msec-precision UTC timer erroneously reporting local time instead of UTC on some systems, we're now also probing the sec-precision UTC timer, which should be more reliable in terms of time zone: The rounded difference between the two should be able to give us the time zone offset (if any) in the msec-precision timer, which we then compensate for accordingly.
c-lipka added a commit that referenced this issue Aug 9, 2021
To work around Boost's msec-precision UTC timer erroneously reporting local time instead of UTC on some systems, we're now also probing the sec-precision UTC timer, which should be more reliable in terms of time zone: The rounded difference between the two should be able to give us the time zone offset (if any) in the msec-precision timer, which we then compensate for accordingly.
@c-lipka c-lipka added this to the v3.8.0-beta.3 milestone Aug 9, 2021
@c-lipka
Copy link
Contributor Author

c-lipka commented Aug 9, 2021

Technically, this issue is fixed in v3.8.0, to be released in v3.8.0-beta.2.

However, the bug has highlighted the shortcomings of the current design, in that the typical use cases for the datetime function would be better catered to by a local time based solution. A mechanism should be devised to make local time output available as an intentional feature.

trevorsandy pushed a commit to trevorsandy/povray that referenced this issue May 21, 2022
To work around Boost's msec-precision UTC timer erroneously reporting local time instead of UTC on some systems, we're now also probing the sec-precision UTC timer, which should be more reliable in terms of time zone: The rounded difference between the two should be able to give us the time zone offset (if any) in the msec-precision timer, which we then compensate for accordingly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant