lukas - 2022-05-30

Hello all,
there is lib IECStringUtils in Codesys that contains FormatDateTime function.

It works just fine.

sFormat := '%t[HH:mm:ss  dd. MM. yyyy]';
sTime := DWORD_TO_STRING(dwTimeDateLocal);
xFormatDateTimeOK := FormatDateTime(cbpResult := ADR(sTime), uiResultCapacity := SIZEOF(sTime), cbpFormat := ADR(sFormat));

sTime then contains 16:40:00 30. 05. 2022, so exactly what i wanted.

But, when I set in Visualization Manager - General Settings - checkbox Use unicodestrings, this function returns in sTime undecoded number. Is this a bug?

I know I can use '%t[HH:mm:ss dd. MM. yyyy]' directly in visu (it works ok in there), but I need date and time string for creating a filename.

xFormatDateTimeOK is still FALSE (with or without "Use unicodestring" checked) - bug as well or i'm missing something?

Thanks for reply, Lukas.