Recent

Author Topic: DateUtils: Daylight saving time did not change  (Read 3165 times)

Timm Thaler

  • New member
  • *
  • Posts: 7
DateUtils: Daylight saving time did not change
« on: March 26, 2017, 09:15:10 pm »
I am running several Lazarus / FPC programs at Raspberry Pi 3 writing events in logfiles. Today it was time for changing to daylight saving time in Germany.

The Raspi changed DST, but the Lazarus programs did not. The wrote the wrong time into the logfiles, 1 hour missing.

After closing this programs and restart them, they got the correct time and wrote them to the logfiles:

Quote
26.03.17 18:41:50 - Beende HC Data <= close program
26.03.17 19:41:53 - Starte HC Data <= this was 3secs after close

In the programs I get the time by "Now" and print it with FormatDateTime like this:

Code: Pascal  [Select][+][-]
  1. FormatDateTime('dd.mm.yy hh:nn:ss', Now)

So I am wondering what is the reason the programs do not recognize the DST change while running, but get the correct DST after restart? Can anyone explain this please?

Timm Thaler

  • New member
  • *
  • Posts: 7
Re: DateUtils: Daylight saving time did not change
« Reply #1 on: March 26, 2017, 09:17:58 pm »
I forgot: I am running Lazarus IDE 1.6.2 with FPC 3.0.0 at the Raspi.

mica

  • Full Member
  • ***
  • Posts: 196
« Last Edit: March 26, 2017, 11:12:47 pm by mica »

Timm Thaler

  • New member
  • *
  • Posts: 7
Re: DateUtils: Daylight saving time did not change
« Reply #3 on: March 27, 2017, 12:28:17 am »
I guess the same happens with "Date" and "Time"?

But why? If I call "date" in the shell it gives correct time. So it should be possible to read the (virtual) system time at any moment.

 

TinyPortal © 2005-2018