[fpc-pascal] Local Time

Carsten Bager carsten at beas.dk
Thu Feb 21 14:23:51 CET 2008


I tried the 221 compiler. The error I reported is gone here, but there still is 
something fishy about it.
When running the 204 program my UTC time is always updated with the 
correct time. But when running the 221 program the time can be behind by 
several minutes.
I then rewrote my GetUtcTime procedure to:

Procedure GetUtcTime(var SystemTime: TSystemTime);
Var
  DateTime:TDateTime;
  fptimeS:TDateTime;
Begin
  fptimeS:=fptime;
  DateTime:=(fptimeS / 86400.0) + 25569.0;
  DateTimeToSystemTime(DateTime,SystemTime);
End;

From

Procedure GetUtcTime(var SystemTime: TSystemTime);
Var
  DateTime:TDateTime;
Begin
  DateTime:=(fptime / 86400.0) + 25569;
  DateTimeToSystemTime(DateTime,SystemTime);
End;

Now it works 

I would not expect to run in to trouble mixing real and integers when having 
real on both the right and left side. What do you say.


Regards Carsten


204 compiler on Arm 9
LTC:21/02-2008 13:53:17:944
UTC:21/02-2008 12:53:17:00

221 compiler on Arm 9
LTC:21/02-2008 13:54:41:925
UTC:21/02-2008 12:56:15:00
Med venlig hilsen
Carsten Bager

BEAS A/S
Brørupvænget 10
DK-7650 Bøvlingbjerg
Tlf. : +45 9788 5222 Fax : +45 9788 5434
www.beas.dk





More information about the fpc-pascal mailing list