Changing the system time does not update Xojo.Core.Date.Now

I have a Linux machine that I set the date and time on with “timedatectl set-time” I would like Xojo.Core.Date.Now to reflect these changes. Right now I have a timer that checks if the system time has changed and then sets a difference variable (seconds of difference from Date.Now). I then converted all Date.Now calls to use a new method called RealDate that returns a new date from Date.Now and the difference variable. I guess it would be better to use DateInterval but still doesn’t seem like the best option.

Has anyone figured something out for this before? Thanks!

You change it WHILE the app is running ?

Yes, I would like to avoid restarting the app, there is a dialog to change it from inside the app so I know when it is changed but Date.Now does not update.

I suspect you wont be able to do this and get the framework to notice a new base date
Some system api’s basically once they are set up as your app starts will ignore other changes until the app is restarted
But that REALLY will depend on which OS apis the framework use

[quote=497122:@Norman Palardy]I suspect you wont be able to do this and get the framework to notice a new base date
Some system api’s basically once they are set up as your app starts will ignore other changes until the app is restarted
But that REALLY will depend on which OS apis the framework use[/quote]

I figured it would rely on a lot of cards lining up, I was just hoping there might be something that might allow me to tell the framework to update its time source.

Short of restarting the app I dont know of one
Maybe @William Yu might know one