Ruby/Time/day

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск

Get all kinds of particulars, such as the day, the day of the week, and the day of the year

stop = Time.local( 20, 15, 1, 30, "jan", 2007, 2, 30, false, "MST")
 
stop.day # the day of the month => 30
stop.yday # how many days so far this year => 30
stop.wday # the day of the week => 2, or Tue (Sun == 0)