with SysTimeRtcConvertDateToUtc and SysTimeRtcConvertUtcToDate i can convert a date to dayofyear ( wYday ). but how can i change wYday back to date ?
I couldn't find an inbuilt function, but..
PROGRAM PLC_PRG VAR lastNewYearsEve : SysTimeRtc.SYSTIMEDATE := (wYear := 2019, wMonth := 12, wDay := 31); wYear: WORD := 2020; wYday: WORD := 1; dDate: Date; dwLastNewYearsEve: DWORD; END_VAR lastNewYearsEve.wYear := wYear - 1; wYday := MAX(MIN(366,wYday),1); SysTimeRtc.SysTimeRtcConvertDateToUtc(lastNewYearsEve,dwLastNewYearsEve); dDate := TO_DATE(dwLastNewYearsEve + wYday * 60*60*24);
Log in to post a comment.
with SysTimeRtcConvertDateToUtc and SysTimeRtcConvertUtcToDate i can convert a date to dayofyear ( wYday ). but how can i change wYday back to date ?
I couldn't find an inbuilt function, but..