Convert unix time to 2012-12-18 18:59:22 (sample)

Hi
i am trying to find out how to convert

bellow 1355354837
to something like

2012-12-13 01:23:27

in linux from command line ,

date -d @1355354837
Wed Dec 12 23:27:17 GMT 2012
i dont need the GMT

but how can i get that by using ruby time module

i went through the google but i am not geting any luck

Thanks

···

--
Posted via http://www.ruby-forum.com/.

Ok i found one way

puts Time.at(1355841956)

but its gives

Tue Dec 18 14:45:56 +0000 2012

but i want like thsi

2012-12-13 01:23:27

···

--
Posted via http://www.ruby-forum.com/.

Quoting robert lengu (lists@ruby-forum.com):

Ok i found one way

puts Time.at(1355841956)

but its gives

Tue Dec 18 14:45:56 +0000 2012

but i want like thsi

2012-12-13 01:23:27

Look at

ri Time#strftime

for instructions about how to format time the exact way that you want.

Carlo

···

Subject: Re: Convert unix time to 2012-12-18 18:59:22 (sample)
  Date: Wed 19 Dec 12 04:55:50AM +0900

--
  * Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
  * di parlare tanto di amore e di rettitudine? (Chuang-Tzu)

ri strftime

Henry