|
Versions Of This Snippet::
Download a raw-text version of this code by clicking on "Download Version"
Latest Snippet Version: :0.002
require 'date' #at the top of the script
aNewDate=Date::new(2004,8,12) #year,month,day
aNewDate::to_s #gives u the saved date as a string
aNewDate=aNewDate::+1 #increases by 1 day
aNewDate=aNewDate::-1 #decreases by 1 day
day=aNewDate::wday() # gives the day of the week as a number, sun=0, mon=1....
week=aNewDate::cweek() #gives the week of year as a number
toDaysDate=Date::today() #creates a Date object with todays date
Submit a new versionYou can submit a new version of this snippet if you have modified it and you feel it is appropriate to share with others..
|
||||||||||||||||||||||||||||||||||||
