From: Rick DeNatale Date: 2008-08-23T07:04:23+09:00 Subject: Re: DateTime in UTC ------=_Part_77372_20255567.1219442898968 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Fri, Aug 22, 2008 at 2:52 PM, Axel Etzold wrote: > > -------- Original-Nachricht -------- > > Datum: Sat, 23 Aug 2008 03:31:10 +0900 > > Von: "bcparanj@gmail.com" > > An: ruby-talk@ruby-lang.org > > Betreff: Re: DateTime in UTC > > > > > > I created the following list of the expected behavior > > fromhttp://www.google.com/googlecalendar/event_publisher_guide.html > > > > > > Hour : Value in UTC > > > 1 : 0900 > > > 2 : 1000 > > > 3 : 1100 > > > 4 : 1200 > > > 5 : 1300 > > > 6 : 1400 > > > 7 : 1500 > > > 8 : 1600 > > > 9 : 1700 > > > 10 : 1800 > > > 11 : 1900 > > > 12 : 2000 > > > 13 : 2100 > > > 14 : 2200 > > > 15 : 2300 > > > 16 : 0000 > > > 17 : 0100 > > > 18 : 0200 > > > 19 : 0300 > > > 20 : 0400 > > > 21 : 0500 > > > 22 : 0600 > > > 23 : 0700 > > > 00 : 0800 > > > > > > Hour:Mins - UTC value > > > 00:00 - 0800 > > > 00:15 - 0815 > > > 00:30 - 0830 > > > 00:45 - 0845 > > > > > > It seems to be using some offset to convert the given date to UTC > > > values. I don't know how to convert a given hour to its UTC value. > > > > Sorry, I meant converting from Date or DateTime object to UTC values > > similar to above sample data for hours and mins. Thanks. > > One of the two times is your local time zone (if it's +08:00, you'll most > probably be in China, Malaysia, Singapore, > the Philippines, somepart of central Indonesia or in Western Australia.) > There is a database collecting time zone details, including daylight > savings time, by Mr. Olson, > and there's a Ruby library to convert from and into UTC ,which is basically > the time zone of > England, disregarding daylight savings time there. > > Look here : > > > http://tzinfo.rubyforge.org/ > http://www.worldtimezone.com/index24.html (the map has nice zoom-in > properties) > > Best regards, > > And for most timezones, the utc offset depends also on the full time, since it is different during the period, if any, for which daylight saving time is observed for the particular timezone. The TZinfo gem can be used to handle this, once you dig in and understand it. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ ------=_Part_77372_20255567.1219442898968--