Hi All,
can i use i Iconv for the following dates
format is mm/dd/yyyy and if the date comes as 5/8/2005.
Thank you all for help,
Date conversion
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 614
- Joined: Fri Feb 06, 2004 3:59 pm
Open DS Manager and write a quick function to test. Your logic would be:
Ans = ICONV(Arg1, "D")
where Arg1 will contain a test date. Hit your Compile button and then the Test button and try 5/8/2005 as the argument. Hit Run and see if the result looks like a number around 13600. I don't know the exact number, but May 15th 1995 was day 10000, so 10 years * 365 days is about 13600.
You will find that ICONV(Arg1, "D/MDY[2,2,4]") is the exact conversion code for your date format. Just a "D" means try to figure it out.
Ans = ICONV(Arg1, "D")
where Arg1 will contain a test date. Hit your Compile button and then the Test button and try 5/8/2005 as the argument. Hit Run and see if the result looks like a number around 13600. I don't know the exact number, but May 15th 1995 was day 10000, so 10 years * 365 days is about 13600.
You will find that ICONV(Arg1, "D/MDY[2,2,4]") is the exact conversion code for your date format. Just a "D" means try to figure it out.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Premium Member
- Posts: 614
- Joined: Fri Feb 06, 2004 3:59 pm
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Just "DMDY" means that the date's in month-day-year order, and Iconv can figure out anything else (delimiters, alpha or numeric month, two or four digit year, and so on).
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.