PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Sysdatetime()
Sysdatetime()
Iniciado por guest, 02,mar. 2016 12:58 - 1 respuesta
Publicado el 02,marzo 2016 - 12:58
Hello,

When i trie to use the SysDateTime() command, my system date andwon't change.
Windev 18.
I've got fulle adminstrator rights, but date won't change.

Below the command I'm using.

SysDateTime("20160202020202002")

Any idea.
Publicado el 02,marzo 2016 - 16:28
Hi, your program really needs admin rights in order to actually change system date! If you start the program "as an administrator" it will change date / time indeed.

Yes, there's a conflict. We want to install / run the program with minimum rights because we seek to avoid the UAC window to show up and disturb user's operation. AND we want to detect whenever the system's time is wrong because we want to ensure correct multi-user operation and correct licensing. You can't serve both intents at at the same time.

My solution is

1 - to stop program operation if the internet is not connected at start-up time.
2 - to access a trusted server in order to retrieve correct date+time
3 - compare the system's date+time with the retrieved date+time.

If the retrieved date+time is far off (you decide what's "far off") the system's date+time, I let the program stop wth the message that they have to get their system's date+time in sync with the official date+time. I give the hint that they can ensure a correct sync just by opening the control panel click on date + time and choose the tab Internet time ... see http://windows.microsoft.com/en-us/windows/set-clock…

Now, your dear customer HAS to fix the date+time problem of his computer, otherwise there's no way to run the program.