Thanks for reading.
If I have an input date and want to know the date one year prior using the input date as my starting point.
Trying to use DateFromDaysSince but need help with the syntax. Can someone please provide and example? Will it handle leap year?
Thanks.
How to calculate date one year prior to an input date
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 26
- Joined: Thu Aug 12, 2010 12:07 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Convert the date to a string. Subtract 1 from the year. Subtract 1 from the day if the date is 02-29. Convert the string into a date. Make sure that the year is not 0001, which requires special handling.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.