Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Incorrect DateTime() result
Message
De
24/03/2020 15:52:03
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
01673795
Message ID:
01673798
Vues:
61
>Hi
>
>I have VFP processes that run on Windows Servers and notice that if I run the process from the VFP command window the result from the DateTime() function matches the local time. However if I then run the same code as a Scheduled Task in Windows then the result from the DateTime() function is out 3 hours. So if the local time is 5:30am then the DateTime() reports 2:30a. This only happens when run from ShellExecute() as a compiled executable or in the Task Scheduler. Upon further investigation I discovered that the WinAPI GetLocalTime() does exactly the same thing.
>
>This is happening on all my Windows Servers (2012, 2016 and 2019). However, they all have the correct time zone setting and the clocks all display the correct local time (EDT). So I had to created my own functions that retrieve the server's UTC time and convert it to local time which works just fine. However, I wondered if others have seen this type of behavior.

Have you checked the regional settings for the account under which you're running the scheduled tasks?
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform