General information
Category:
Coding, syntax & commands
What about:
lddate=date()
?datetime(year(lddate)-3,month(lddate), day(lddate))
The only problem I see here for february 29 of the leap year (it will return empty date for initial lddate=02/29/2000).
>I want to know if someone has a neet function to add/substract whole years to a date or datetime. It needs to take into account leap years and check that it doesn't produce illegal dates (ex: add 5 years to Feb 29 2004).
>
>I know I could code the long way - but is there some FOXPRO function (foxpro has a function for everything) or ellegant snippet that I can use.
>
>Thanks from frigid Ottawa Canada
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only