import utc in Time

L

Luca Roma

Hi, i'm using facebooker for receiving facebook's events.
I receive the time of the event in utc format.

how can i import it in a Time object

in other words

a= Time.now.utc

how can i import a in a Time object??

this not works
Time.parse(a)

thanks
 
B

Bertram Scharpf

Hi,

Am Donnerstag, 17. Sep 2009, 01:12:30 +0900 schrieb Luca Roma:
Hi, i'm using facebooker for receiving facebook's events.
I receive the time of the event in utc format.

how can i import it in a Time object

in other words

a= Time.now.utc

how can i import a in a Time object??

this not works
Time.parse(a)

UTC is a time zone, not a format. You need to load "time.rb".

t = Time.now
str_l = t.to_s
t.utc
str_u = t.to_s

require "time"
q = Time.parse str_l
puts q
q = Time.parse str_u
puts q

Bertram
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top