Parsing a strange date

Hi,

i’m parsing squid log in Ruby and i’ve failed to analyse the date with the
parsedate module.
The date looks like “1046014262.083”.

How it can be done in Ruby ?

Regards

The date looks like "1046014262.083".

pigeon% ruby -e 'p Time.at(1046014262)'
Sun Feb 23 16:31:02 CET 2003
pigeon%

no ?

Guy Decoux

It looks like a timestamp:

irb(main):001:0> d = Time.at("1046014262.083".to_f)
Sun Feb 23 15:31:02 GMT 2003

Regards,

Brian.

···

On Wed, Mar 05, 2003 at 12:37:35AM +0900, Cedric Foll wrote:

i'm parsing squid log in Ruby and i've failed to analyse the date with the
parsedate module.
The date looks like "1046014262.083".

How it can be done in Ruby ?

I’ve found the solution, it was trivial sorry for this post:

cedric@follc:~$ ruby -e 'p Time.at(1046014262)'
Sun Feb 23 16:31:02 CET 2003