Ruby formats time objects in a specific way by default.
Ruby time utc.
For example rational 3 24 represents ahead of 3 hours of utc rational 5 24 represents behind of 5 hours of utc.
Utc is a time class method which returns the conversion of time to utc gmt modifying the receiver.
The time class treats gmt greenwich mean time and utc coordinated universal time as equivalent gmt is the older way of referring to these baseline times but persists in the names of calls on posix systems.
Ruby time utc function last updated.
Time is stored internally as the number of seconds with fraction since the epoch january 1 1970 00 00 utc also see the library module date.
Time now utc ruby time formatting.
Usr bin ruby w time time new values time to a p values this will generate the following result 26 10 12 2 6 2008 1 154 false mst this array could be passed to time utc or time local functions to get different format of dates as follows.
If you want the time zone offset you can use the utc offset method.
Time is an abstraction of dates and times.
The offset should be 1 to 1 and its precision is assumed at most second.
The output for this method is in seconds but you can divide by 3600 to get it in hours.