You may also use embedded SQL:
Exec SQL Set :NewTimestamp = Timestamp_Format(Substr(:YourTimestamp, 1, 19))
+
Case When Upper(Right(:Yourtimestamp, 2)) = 'PM' Then 12
else 0 End;
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
-----Ursprüngliche Nachricht-----
Von: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im Auftrag von Gqcy
Gesendet: Tuesday, 21.10 2014 17:49
An: rpg400-l@xxxxxxxxxxxx
Betreff: convert a time date string into a timestamp
I have been looking for examples to convert the following string into a
valid timestamp:
"2014-07-25 08:28:04 AM"
I initially made a DS breaking apart date from time, but I am now having
trouble with the time string...
time_a = %char(%time(time_part:*usa):*ISO);
is not working...
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.