Hallo,
ich hab eine Zeitangabe in meiner Tabelle bestehend aus Datum und Uhrzeit, die hol ich mir als Timestamp per SQL ins RPG-Programm - Dieser Zeitstempel ist aber in UTC Zeit und ich benötige meine MEZ Zeit...
Ich hab versucht mit dem QWCCVTDT das ganze umzuwandeln, komm aber nicht weiter...
Code:dcl-proc UtcToLocalTimestamp; dcl-pi *n timestamp; pUTCTime timestamp const; pUTCTimezone char(10) const options(*nopass); end-pi; dcl-ds errorCode qualified inz; qusec likeds(qusec); msgData char(1024); end-ds; dcl-ds timezoneInfo likeds(qwctzi) inz; dcl-s UTCTimezone char(10) inz('*UTC'); dcl-s lclString char(20) inz; dcl-s lclTime timestamp inz; if %parms() >= %parmnum(pUTCTimezone) and %addr(pUTCTimezone) <> *null; UTCTimezone = pUTCTimezone ; endif; errorCode.qusec.qusbprv = %size(errorCode); convertDateTime('*YYMD':%char(pUTCTime:*iso0): '*YYMD':lclString: errorCode: UTCTimezone:'*CEST': timezoneInfo:%size(timezoneInfo):'1'); if errorCode.qusec.qusbavl = *zero; lclTime = %timestamp(lclString:*iso0); else; endif; return lclTime; end-proc;
Ich bekomm immer den Fehler "CPF3C3C Value for parameter &1 not valid."
Meine Eingabe Timestamp ist "2025-07-03 00:30:57.000000000"
Vielen Dank für die Hilfe
![[NEWSboard IBMi Forum]](images/duke/nblogo.gif)



Mit Zitat antworten

Bookmarks