# Re: File.mtime: Bug on Windows?

**URL:** <https://www.ruby-forum.com/t/re-file-mtime-bug-on-windows/93363>\
**Category:** Ruby\
**Created:** [March 31, 2006, 6:16pm UTC](https://www.ruby-forum.com/t/re-file-mtime-bug-on-windows/93363 "2006-03-31T18:16:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BergerS\_Daniel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc8723/32.png) [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Post date:** [March 31, 2006, 6:16pm UTC](https://www.ruby-forum.com/t/re-file-mtime-bug-on-windows/93363/1 "2006-03-31T18:16:39Z")

</div>

> I think, there is a bug in File.mtime, unfortunately:
> 
> Using:  
> ruby 1.8.4 (2005-12-24) [i386-mswin32]  
> Windows XP with NTFS filesystem
> 
> When reading File.mtime( ‘any existing filename’),  
> the result is different by one hour, when doing this with the  
> computer clock set to a daylight saving time (DST) and doing this  
> with the computer clock set to a standard time.

The bug, if you are correct, is in the Windows’ implementation of \_stat  
(or \_stat64).

I think your best bet is, perhaps using the Perl module as a baseline,  
to submit a patch to win32.c to ruby-core, keeping in mind that future  
versions of Windows just might fix this bug.

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![BergerS\_Daniel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc8723/32.png) [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Post date:** [April 2, 2006, 7:10pm UTC](https://www.ruby-forum.com/t/re-file-mtime-bug-on-windows/93363/2 "2006-04-02T19:10:58Z")

</div>

Hello Dan,

> I think your best bet is, perhaps using the Perl module as a  
> baseline, to submit a patch to win32.c to ruby-core,

I think, you are right. Sorry to say, that I don’t know programming  
perl nor any kind of c. So I think, I’ll not succeed in doing this.  
(Most of Ruby-programming I do at home, just for fun. Only  
occasionally, I use Ruby in my office for making my job somewhat  
easier… .)

Regards,

Axel
