-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
touch -t
fails on Linux if machine has timezone GMT
#2761
Comments
@barnex do you want to propose a fix? |
Sure, happy to look into this. |
@barnex ping? |
When I update the time comparison to take UTC offsets into account, the test in question passes, but then other tests fail because we now accept some timestamps that GNU rejects. I'm afraid that I'll have to hand off this issue at this point. Perhaps @ajanicij who wrote the initial timestamp checks is better placed to look into this. |
I will look into it. |
Hi, wanted to look at this recently and it seems to pass the tests, can this be closed? |
Sorry I haven't had time to look into it. It's good news that it is passing. @qua3k In which timezone did you try it? |
This was with GMT (temporarily symlinked /etc/localtime to the appropriate file on Ubuntu 22.04) |
cargo test
currently fails on my Debian and my Ubuntu 21.04 machine, both of which have timezone GMT (UTC+0).Actually
cargo run touch -a -t xxxxxxxxxx file
fails for any valid timestamp, irrespective of it being near daylight saving time changes or not.When I change my timezone to anything other than GMT, the issue disappears.
I suspect this issue may be related to handling of daylight saving time, introduced in 85a7375#diff-9565d8fad7b29837b3b468a61a809dc187fb351a72421ffe4b7c4879a8445b27R279.
Adding debug statements for that code shows, for the failing test case:
Note the difference in
tm_utcoff
between the two, which appears to be the cause of this issue: even though the two times are equivalent, they have a differenttm_hour
, causing them to be interpreted as different and therefore invalid.The text was updated successfully, but these errors were encountered: