Dear All
I am getting the datatime as YYYYMMDD_HHMMSS when using DSJ.JOBLASTTIMESTAMP in the routine.
I need to convert YYYYMMDD_HHMMSS to YYYY-MM-DD HH:MM:SS using iconv and oconv .
Can anyone please suggest me how to do this.
Convert datetime using iconv, oconv
Moderators: chulett, rschirm, roy
There is no need to use ICONV() and OCONV() here, a simple string function works more efficiently:
Code: Select all
LastTS[1,4]:'-':LastTS[5,2]:'-':LastTS[7,2]:' ':LastTS[10,2]:':':LastTS[12,2]:':':LastTS[14,2]
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I think that the substringing approach suggested by Arnd is probably more efficient, but wonder how close the following construction would be.
Code: Select all
Fmt(Convert("_","",LastTS),"L####-##-## ##:##:##")
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: