gm

Time.gm(year) â time
Time.gm(year, month) â time
Time.gm(year, month, day) â time
Time.gm(year, month, day, hour) â time
Time.gm(year, month, day, hour, min) â time
Time.gm(year, month, day, hour, min, sec_with_frac) â time
Time.gm(year, month, day, hour, min, sec, usec_with_frac) â time
Time.gm(sec, min, hour, day, month, year, wday, yday, isdst, tz) â time
Class Public methods

Creates a Time object based on given values, interpreted as UTC (GMT). The year must be specified. Other values default to the minimum value for that field (and may be nil or omitted). Months may be specified by numbers from 1 to 12, or by the three-letter English month names. Hours are specified on a 24-hour clock (0..23). Raises an ArgumentError if any values are out of range. Will also accept ten arguments in the order output by #to_a.

sec_with_frac and usec_with_frac can have a fractional part.

Time.utc(2000,"jan",1,20,15,1)  #=> 2000-01-01 20:15:01 UTC
Time.gm(2000,"jan",1,20,15,1)   #=> 2000-01-01 20:15:01 UTC
doc_ruby_on_rails
2015-05-17 17:41:16
Comments
Leave a Comment

Please login to continue.