Ruby/Time/day

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

(Различия между версиями)
Перейти к: навигация, поиск
м (1 версия: Импорт выборки материалов по Ruby)
 

Текущая версия на 17:57, 13 сентября 2010

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)