mirror of
https://github.com/thiagoralves/OpenPLC_v3.git
synced 2026-09-25 17:14:35 +08:00
Merge pull request #125 from LeeBrown/master
Provide UTC clock and optimize tzset()
This commit is contained in:
@@ -159,8 +159,10 @@ void handleSpecialFunctions()
|
||||
struct tm *current_time;
|
||||
time_t rawtime;
|
||||
|
||||
tzset();
|
||||
time(&rawtime);
|
||||
// store the UTC clock in [%ML1027]
|
||||
if (special_functions[3] != NULL) *special_functions[3] = rawtime;
|
||||
|
||||
current_time = localtime(&rawtime);
|
||||
|
||||
rawtime = rawtime - timezone;
|
||||
@@ -187,6 +189,7 @@ int main(int argc,char **argv)
|
||||
//======================================================
|
||||
// PLC INITIALIZATION
|
||||
//======================================================
|
||||
tzset();
|
||||
time(&start_time);
|
||||
pthread_t interactive_thread;
|
||||
pthread_create(&interactive_thread, NULL, interactiveServerThread, NULL);
|
||||
|
||||
Reference in New Issue
Block a user