Time.gm(2006).strftime('The year is %Y!') : strftime « Time « Ruby






Time.gm(2006).strftime('The year is %Y!')



puts Time.gm(2006).strftime('The year is %Y!')   # => "The year is 2006!"

 








Related examples in the same category

1.Time#strftime directives
2.Format time as '%D'
3.Format time as '%d/%m/%y'
4.Format time as '%m/%d/%Y'
5.Format time as '%m-%d-%Y %H:%M:%S %Z'
6.Format time as '%m-%d-%Y %I:%M:%S %p'
7.Format time as '%A, %B %d, %Y'
8.strftime("%U") and strftime("%W")