Hi,

--- Philipp Meier <meier / meisterbohne.de> wrote:
> Hello,
> 
> how can I parse a Date from a String into a Time
> object?
> 
> I tried the following but the timezone seems to be
> ignored:
> 
> irb(main):012:0>  t = ParseDate.parsedate("Tue, 16
> Jul 2002 21:25:08 +0200")
> [2002, 7, 16, 21, 25, 8, "+0200", 2]
> irb(main):013:0>
>
Time.gm(t[5],t[4],t[3],t[2],t[1],t[0],nil,nil,nil,t[7])
> Tue Jul 16 21:25:08 UTC 2002
> irb(main):014:0>
>
Time.local(t[5],t[4],t[3],t[2],t[1],t[0],nil,nil,nil,t[7])
> Tue Jul 16 21:25:08 CEST 2002
> irb(main):015:0>
>
Time.local(t[5],t[4],t[3],t[2],t[1],t[0],nil,nil,nil,"+0300")
> Tue Jul 16 21:25:08 CEST 2002
> irb(main):016:0>
>
Time.gm(t[5],t[4],t[3],t[2],t[1],t[0],nil,nil,nil,"+0300")
> Tue Jul 16 21:25:08 UTC 2002
> irb(main):017:0> 
> 

require 'time'

t = Time.rfc2822("Tue, 16 Jul 2002 21:25:08 +0200")


Park Heesob


__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com