-
Notifications
You must be signed in to change notification settings - Fork 329
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
Faketime breaks UTC offsets? #444
Comments
libfaketime is agnostic to timezones, just like the signatures of the functions it intercepts (see #364). It is typically left to the application on top of libfaketime to interpret the reported times in the context of a timezone. If the original functions, which are wrapped by libfaketime interception, can be influenced through environment variables such as |
OK, so is the implication here that the bug is in the |
No implications, since I don't know how the |
I appreciate your rational approach to this; but there must be a bug SOMEWHERE, since To be honest, I ran into trouble with some of my code using libfaketime, and when trying to debug THAT, I discovered this strange behaviour and I decided that it would be easier for me to spin up a VM and fake out the time in there than to figure out what's going on with libfaketime. To conclude: I no longer need libfaketime, since I solved by debugging needs in other ways; and I'm not invested enough in this particular problem to do any digging. Close if you like. |
As outlined in the mentioned #364, the problem can be avoided by using relative time offsets instead of absolute ones (e.g., I'll dig into why GNU Since you mentioned discovering the issue when working on your own code, it'd be helpful to have some minimum example of where you get something back from a libfaketime-intercepted function, which does not meet expectations. Of course it's good you found another solution for the problem at hand and I understand if you can't put any more time into this. |
$ LD_PRELOAD=/.../libfaketime/src/libfaketime.so.1 FAKETIME='2023-12-01 00:00:00' date --utc
Fri Dec 1 00:00:00 EST 2023
I have been having trouble with using libfaketime in one of my projects, and I think I narrowed it down to this use case (above).
When using libfaketime, any attempt to get a UTC time, instead gets a local time. This plays havoc with some of my other code.
I was hoping to fake out the UTC time value, such that you could use whatever timezone you wanted in the app and it would apply an offset.
The text was updated successfully, but these errors were encountered: