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

Faketime issue with date timezone conversion #461

Open
kotsis opened this issue Mar 8, 2024 · 0 comments
Open

Faketime issue with date timezone conversion #461

kotsis opened this issue Mar 8, 2024 · 0 comments

Comments

@kotsis
Copy link

kotsis commented Mar 8, 2024

Hello everyone, I got a weird case of Faketime affecting/interfering with a simple date conversion, which I wouldn't expect, since it is a simple date conversion of a specific timestamp. It also seems to only happen in RockyLinux8 distro.

e.g. in Centos7:

[root@vagrant vagrant]# cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)

[root@vagrant vagrant]# date -d @1396627200
Sat Apr  5 00:00:00 +08 2014

#utc date -08:00
[root@vagrant vagrant]# date -u -d @1396627200 +%Y-%m-%dT%H:%M:00Z
2014-04-04T16:00:00Z

#utf date -08:00 with faketime matches, all good
[root@vagrant vagrant]# LD_PRELOAD=/usr/local/lib/faketime/libfaketime.so.1 date -u -d @1396627200 +%Y-%m-%dT%H:%M:00Z
2014-04-04T16:00:00Z

But in RockyLinux8 distro:

[root@vagrant vagrant]# cat /etc/centos-release
Rocky Linux release 8.9 (Green Obsidian)

[root@vagrant vagrant]# date -d @1396627200
Sat Apr  5 00:00:00 +08 2014

#utc date -08:00
[root@vagrant vagrant]# date -u -d @1396627200 +%Y-%m-%dT%H:%M:00Z
2014-04-04T16:00:00Z

#utf date -08:00 with faketime is wrong now!
[root@vagrant vagrant]# LD_PRELOAD=/usr/local/lib/faketime/libfaketime.so.1 date -u -d @1396627200 +%Y-%m-%dT%H:%M:00Z
2014-04-05T00:00:00Z

Not sure why this happens only in RockyLinux8 , last case.

PS: I use LD_PRELOAD for a bash script, which contains above date conversions, and the bug in RockyLinux8 boils down to above case.

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