Hi All
I have a requirement where i need to subtract 7 days from the date.The source date has date format of yyyy-mm-dd.
For a sample date of 2003-01-10,the output should be 2003-01-03 and for 2003-01-03 the output should be 2002-12-27
I tried using Oconv and Iconv but could not get to the solution.Please help me to acheive the same.
Thanks in advance
Subtract Week From Date
Moderators: chulett, rschirm, roy
You might want to post what you've tried so far. It's just a simple Iconv to get it into a Internal date, subtract 7 from that and then Oconv it back out in the format you want to see it - all doable in one 'line' provided you don't need to do any error checking.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom