hideto 发表于 2013-1-27 06:04:16

Ruby common time and date format specifiers

%Y
Year(four digits)

%y
Year(last two digits)

%b, %B
Short month name, full month name

%m
Month(number)

%d
Day of month(left-padded with zeros)

%e
Day of month(left-padded with blanks)

%a, %A
Short day name, full day name

%H, %I
Hour(24-hour clock), hour(12-hour clock)

%M
Minute

%S
Second

%c
Equivalent to "%a %b %d %H:%M:%S %Y"

%x
Equivalent to "%m/%d/%y"
页: [1]
查看完整版本: Ruby common time and date format specifiers