# Ruby1.8.6 File.utime question

**URL:** <https://www.ruby-forum.com/t/ruby1-8-6-file-utime-question/152407>\
**Category:** Ruby\
**Created:** [November 3, 2008, 4:57pm UTC](https://www.ruby-forum.com/t/ruby1-8-6-file-utime-question/152407 "2008-11-03T16:57:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zswu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/bc79bd/32.png) [@zswu](https://www.ruby-forum.com/u/zswu)\
**Post date:** [November 3, 2008, 4:57pm UTC](https://www.ruby-forum.com/t/ruby1-8-6-file-utime-question/152407/1 "2008-11-03T16:57:54Z")

</div>

Hi,

Because of my poor English, I beg there would be some kind guy could  
understand me … 🙂

I’m facing a strange problem. Please check code bleow:

time = Time.local( 2008, ‘oct’, 30, 11, 25, 37 ) # Thu Oct 30  
11:25:37 +0800 2008  
File.utime Time.now, time, pathname  
File.open pathname do | f |  
print f.mtime # Thu  
Oct 30 11:25:38 +0800 2008  
end

The result would be 1sec faster than the required value. But if setted  
mtime as Time.local( 2008, ‘oct’, 30, 11, 25, 40 ), there would be no  
problem.  
It seems like the odd second value has been aligned at 2.

I have tested this problem at two different computers:

1. PC: Intel Core2 + WinXP SP3 + Ruby1.8.6 \<--------- This is  
Ok
2. Laptop: Inter Core1 + WinXP SP2 + Ruby1.8.6 \<--------- Wrong …

Could someone tell me what had happened ?

–  
Thanks,  
best regards.

---

<div class="post-metadata">

**Author:** ![zswu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/bc79bd/32.png) [@zswu](https://www.ruby-forum.com/u/zswu)\
**Post date:** [November 3, 2008, 6:54pm UTC](https://www.ruby-forum.com/t/ruby1-8-6-file-utime-question/152407/2 "2008-11-03T18:54:31Z")

</div>

Hi,

At Tue, 4 Nov 2008 00:55:44 +0900,  
zswu wrote in [ruby-talk:319277]:

> It seems like the odd second value has been aligned at 2.
> 
> I have tested this problem at two different computers:
> 
> 1. PC: Intel Core2 + WinXP SP3 + Ruby1.8.6 \<--------- This is Ok
> 2. Laptop: Inter Core1 + WinXP SP2 + Ruby1.8.6 \<--------- Wrong …

FAT based file system has no capability to store the odd second  
value.

---

<div class="post-metadata">

**Author:** ![zswu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/bc79bd/32.png) [@zswu](https://www.ruby-forum.com/u/zswu)\
**Post date:** [November 4, 2008, 12:48am UTC](https://www.ruby-forum.com/t/ruby1-8-6-file-utime-question/152407/3 "2008-11-04T00:48:17Z")

</div>

Hi Nakada,

Thanks very much. I’m going to try 🙂

On Tue, Nov 4, 2008 at 1:49 AM, Nobuyoshi N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> FAT based file system has no capability to store the odd second  
> value.
> 
> –  
> Nobu Nakada

–  
Thanks,  
best regards.
