From: Gabriele Marrone Date: 2006-11-12T01:40:42+09:00 Subject: Re: best way to get epoch seconds from mysql datetime value On 11/nov/06, at 17:32, shawn bright wrote: > Hey there all, > > if i have a mysql datetime value that looks like this: > some_time = '2006-05-11 05:14:14' > > and i want to get seconds since the unix epoch, how would i go > about that ? > > thanks $ irb >> require 'date' => true >> some_time = '2006-05-11 05:14:14' => "2006-05-11 05:14:14" >> time = Time.parse(some_time) => Thu May 11 05:14:14 0200 2006 >> time.to_i => 1147317254 -- Gabriele Marrone