Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007660OCamlotherlibspublic2017-10-24 09:462017-12-20 17:59
Reporternojebar 
Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusresolvedResolutionfixed 
PlatformOSWindowsOS Version
Product Version4.05.0 
Target Version4.07.0+dev/beta2/rc1/rc2Fixed in Version4.07.0+dev/beta2/rc1/rc2 
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 (developer)
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 (developer)
2017-10-25 11:03

See https://github.com/ocaml/ocaml/pull/1445 [^] for possible fix.
(0018759)
xleroy (administrator)
2017-12-20 17:59

Pull request was merged in trunk, will be in 4.07.

- 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
2017-11-26 18:09 xleroy Status new => acknowledged
2017-11-26 18:09 xleroy Target Version => 4.07.0+dev/beta2/rc1/rc2
2017-12-20 17:59 xleroy Note Added: 0018759
2017-12-20 17:59 xleroy Status acknowledged => resolved
2017-12-20 17:59 xleroy Resolution open => fixed
2017-12-20 17:59 xleroy Fixed in Version => 4.07.0+dev/beta2/rc1/rc2


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker