Mega Code Archive

 
Categories / Ruby / Time
 

Retrieve the year, the month, and the timezone

stop = Time.local( 20, 15, 1, 30, "jan", 2007, 2, 30, false, "MST") stop.year # => 2007 stop.month # => 1 (January) stop.zone # timezone => "MST" or Mountain Standard Time