CODESYS - the IEC 61131-3 automation software
https://forum.codesys.com/

System Date Time
https://forum.codesys.com/viewtopic.php?f=11&t=8988
Page 1 of 1

Author:  toatan.th@gmail.com [ Fri Jul 13, 2018 1:29 pm ]
Post subject:  System Date Time

Now i have to find “How to get the system date and time”

> I download “date time”. In store library.
> Can you guide me , how can i program to get date and time.
> My application , set up time to open /close lamps in my house.
> Example
> Lamp on 18:00 to 5:00,
> Thanks

Author:  Vijolica555 [ Mon Aug 20, 2018 3:14 pm ]
Post subject:  Re: System Date Time

Hello,

VAR
fbGetSystemTime : GETSYSTEMTIME;
fileTime : T_FILETIME;
sTime : STRING;
END_VAR
_______________________

fbGetSystemTime(timeLoDW=>fileTime.dwLowDateTime, timeHiDW=>fileTime.dwHighDateTime );
sTime := SYSTEMTIME_TO_STRING( FILETIME_TO_SYSTEMTIME(fileTime));

Page 1 of 1 All times are UTC+01:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/