Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007660OCamlotherlibspublic2017-10-24 09:462017-10-25 11:03
Reporternojebar 
Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusnewResolutionopen 
PlatformOSWindowsOS Version
Product Version4.05.0 
Target VersionFixed in Version 
Summary0007660: Unix.utimes under Windows may shift timestamp depending on DST setting
Description0007385 strikes back!

When "Adjust for daylight saving time automatically" is ON in your Windows settings, the function Unix.utimes can shift the passed timestamp by one hour depending on DST. If the setting is OFF the timestamp seems to be left unchanged.

It MAY be that this bug only became more evident due to the fix for 0007385, which solved a similar issue for Unix.stat. Before that, the two functions's bugs may have cancelled each other. (This is just a guess, I did not verify it.)
Steps To Reproduce# Set "Adjust for daylight saving time automatically" to ON

$ touch foo.txt
$ ocaml unix.cma
# let t0 = 1508391026.;;
val t0 : float = 1508391026.
# Unix.utimes "foo.txt" t0 t0;;
- : unit = ()
# let t1 = (Unix.stat "foo.txt").Unix.st_mtime;;
val t1 : float = 1508387426.
# t0 -. t1;;
- : float = 3600.

# You can check on Cygwin that the mtime is the correct one, so the problem
# is with Unix.utimes, not Unix.stat:

$ stat --format=%Y foo.txt
1508387426
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0018615)
nojebar (reporter)
2017-10-24 18:03

FYI, I tried to reproduce with commit 7fefb22da730d4373f416d7b216772edbf4fa115, shortly before the merging of the the fix to Unix.stat. The bug is also there, but the difference t0 -. t1 is -3600. (!).
(0018618)
nojebar (reporter)
2017-10-25 11:03

See https://github.com/ocaml/ocaml/pull/1445 [^] for possible fix.

- Issue History
Date Modified Username Field Change
2017-10-24 09:46 nojebar New Issue
2017-10-24 18:03 nojebar Note Added: 0018615
2017-10-25 11:03 nojebar Note Added: 0018618


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker