i can

Dawn May

Dawn May

Bookmark and Share

October 2014

Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

« IBM Systems Director 6.3 and IBM i | Main | A Peek at AIX From an “i Guy” (ok, Girl) »

March 05, 2012


So after reading your post I wondered: In RPGLE, how would I get the current UTC in timestamp format (to avoid some of the issues you mentioned at the beginning)? I check a few APIs and noticed that QWCCVTDT has had some optional parameters added since I last used it. It appears that calling it with appropriate values and then converting the 20-character output with %timestamp(Output:*ISO0) will do it. Or is there an even easier way?

Russ, you are correct. The Convert Date and Time Format (QWCCVTDT) API can be used to convert from UTC to another time zone or vice versa and can be converted to one of several formats. It can also be used to get the current time of day and return it in any format. I'm not an RPG expert, but I believe there may a built-in function to get the current date-time also, but I think the RPG run-time uses this same API under the covers, so I guess it depends on what you are doing, as to which would be easier.

The comments to this entry are closed.