Recent

Author Topic: Summer/Winter time change  (Read 2437 times)

BLL

  • Sr. Member
  • ****
  • Posts: 276
Summer/Winter time change
« on: October 29, 2017, 10:05:40 am »
Hi
Can someone explain this:

This morning, my program written in lazarus, which runs 24/7 on my RasPi3 was displaying the wrong time. When it was actually 07:08, my program said 08:08. My program repeatedly calls the Now function and displays the result.

On exiting my program, the clock on the tray was reading correctly! I restarted my program and the time was now correctly displayed!

Why was Now misreading until I stopped & started my program? Can I correct this problem and if so, how please?

Thanks

Brian

munair

  • Hero Member
  • *****
  • Posts: 798
  • compiler developer @SharpBASIC
    • SharpBASIC
Re: Summer/Winter time change
« Reply #1 on: October 29, 2017, 10:54:34 am »
The same problem was discussed earlier. See this thread where links are provided to a possible solution: http://forum.lazarus.freepascal.org/index.php?topic=36334.0
keep it simple

BLL

  • Sr. Member
  • ****
  • Posts: 276
Re: Summer/Winter time change
« Reply #2 on: October 30, 2017, 04:02:25 pm »
Thanks Munair

I chased the links and came to  the suggestion to add:
ReadTimezoneFile(GetTimezoneFile);
GetLocalTimezone(fptime);

However, I don't understand the fptime var. The function says it should be a long, but nowhere can I find an example of GetLocalTimezone that indicates what the value means or should be set to, so I am stuck!

 

TinyPortal © 2005-2018