script to calculate days between two dates

Hi,

Does anyone know if a string can be converted to a date i.e. "23/09/2013" so that I could simply subtract a number from it and display the new date. something like the following:

oldDate = Date("23/09/2013")
newDate = oldDate - 10

print newDate as string

giving me a result "13/09/2013"

Currently the only way I can do this is to create an array of days, months and years so as to calculate based on which month has which number of days and which year is a leap year. This method works fine but is very long winded.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miauu's picture

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.