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]
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
There should be enough visible to show you how to go about building the string correctly. The site is kept running by volunteers and by premium memberships and it would seem that the user ID you are using has let this lapse and for this reason the whole message is not visible to you.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- 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: