Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

System Date Time

Anonymous
2018-07-13
2018-08-20
  • Anonymous - 2018-07-13

    Originally created by: toatan.th@gmail.com

    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

     
  • Vijolica555 - 2018-08-20

    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));

     

Log in to post a comment.