From: "Jan E." Date: 2012-06-09T06:48:44+09:00 Subject: Re: Problem with storing timestamp as datetime object Hi, You should use the built-in method to get the mtime of a file rather than fumble with the console: time_1 = File.mtime 'myfile.foo' This returns a Time object (independend of the platform). Then you can load the Time extension from the standard library, parse the timestamp from the database and compare the Time object to the one above: #----------------------- require 'time' time_1 = File.mtime 'myfile.foo' # mtime of file time_2 = File.parse '2012-06-05 14:16:28 UTC' # from database puts time_1 == time_2 #----------------------- -- Posted via http://www.ruby-forum.com/.