From: Ryan Davis Date: 2012-06-09T07:59:42+09:00 Subject: Re: Problem with storing timestamp as datetime object On Jun 8, 2012, at 15:53, "cyber c." wrote: > Hi, > > Thanks for the reply. But i see a problem here > > time_1 = File.mtime 'myfile.foo' # mtime of file > this returns "Thu Dec 22 16:26:43 -0800 2011" > time_2 = Time.parse '2012-06-05 14:16:28 UTC' # from database > returns "Thu Dec 22 16:26:43 UTC 2011" > > so the UTC and -0800 characters dont match and as a result the strcmp > fails. It isn't a matter of utc vs 0800... Those are completely different times and would fail any equality comparison.