You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 7660 Reporter:@nojb Status: resolved (set by @xavierleroy on 2017-12-20T16:59:37Z) Resolution: fixed Priority: normal Severity: minor OS: Windows Version: 4.05.0 Target version: 4.07.0+dev/beta2/rc1/rc2 Fixed in version: 4.07.0+dev/beta2/rc1/rc2 Category: otherlibs Monitored by:@gasche
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 #7385, 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
The text was updated successfully, but these errors were encountered:
FYI, I tried to reproduce with commit 7fefb22, shortly before the merging of the the fix to Unix.stat. The bug is also there, but the difference t0 -. t1 is -3600. (!).
Original bug ID: 7660
Reporter: @nojb
Status: resolved (set by @xavierleroy on 2017-12-20T16:59:37Z)
Resolution: fixed
Priority: normal
Severity: minor
OS: Windows
Version: 4.05.0
Target version: 4.07.0+dev/beta2/rc1/rc2
Fixed in version: 4.07.0+dev/beta2/rc1/rc2
Category: otherlibs
Monitored by: @gasche
Bug description
#7385 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 #7385, 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;;
let t1 = (Unix.stat "foo.txt").Unix.st_mtime;;
val t1 : float = 1508387426.
t0 -. t1;;
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
The text was updated successfully, but these errors were encountered: