Hi,
I am unable to convert 28-09-2008 01:01:00 to 2008-09-28 01:01:00. How to do this with Iconv and Oconv.
Regards,
Arnie
Timestamp conversion
Moderators: chulett, rschirm, roy
DataStage server has no timestamp, just Date and Time, so both parts need to be done separately. Assuming you have a string input value you need to:
Step 1, convert date to internal : ICONV(In.Date[1,10],'D4-DMY')
Step 2 convert internal to date : OCONV(Step1Result,'D4-YMD')
Everything in one line:
Step 1, convert date to internal : ICONV(In.Date[1,10],'D4-DMY')
Step 2 convert internal to date : OCONV(Step1Result,'D4-YMD')
Everything in one line:
Code: Select all
OCONV(ICONV(In.Date[1,10],'D4-DMY'),'D4-YMD'):In.Date[11,9]
Try this
Code: Select all
Oconv(ICONV(In.Date[1,10],"D-MY(2,2,4)"),"Y-MD(4,2,2)"):Right(In.Date,9)
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Almost, but not quite (and therefore wrong). You left the day specifications out of Iconv and Oconv arguments.laknar wrote:Try thisCode: Select all
Oconv(ICONV(In.Date[1,10],"D-MY(2,2,4)"),"Y-MD(4,2,2)"):Right(In.Date,9)
Code: Select all
Oconv(Iconv(Left(In.Date,10), "DDMY"), "D-YMD[4,2,2]") : Right(In.Date, 9)
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.