From: "bcparanj@..." Date: 2008-08-23T03:31:10+09:00 Subject: Re: DateTime in UTC On Aug 22, 1:55 am, Axel Etzold wrote: > > How do I extract the hour and minutes in UTC from a DateTime object? I > > have looked at the Ruby cookbook and Ruby Way with no luck. > > > When I try: > > > >> d = DateTime.new(2008,8, 20, 12, 15) > > => Wed, 20 Aug 2008 12:15:00 +0000 > > >> d.zone > > => "+00:00" > > >> d.min > > => 15 > > >> d.hour > > => 12 > > What behaviour are you expecting ? > > Best regards, > > Axel > -- > Psssst! Schon das coole Video vom GMX MultiMessenger gesehen? > Der Eine für Alle:http://www.gmx.net/de/go/messenger03 I created the following list of the expected behavior from http://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.