Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2007-01

TDateTime, TDate, TTime types

5 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

Does FPC have all the above types defined as Delphi does? I can only find a TDateTime in FPC.

Saying that, it looks a bit confusing in Delphi. I can define a variable in Delphi as TDate, but still be able to set the time!! So I guess I don't see the point of a TDate and TTime types

Maybe we can add the following into FPC just to be compatible with Delphi?

TDate = type TDateTime;
TTime = type TDateTime;
Graeme Geldenhuys There's no place like S34° 03.168' E018° 49.342'

Reply by email

Joost van der Sluis
to Graeme Geldenhuys
Graeme Geldenhuys wrote
Maybe we can add the following into FPC just to be compatible with Delphi? TDate = type TDateTime; TTime = type TDateTime;

I didn't even knew that Delphi has a TDate type. According to the Delphi-help it's the same at TDateTime, so for compatibility it can be added, yes. But I miss the point, why do they exist?

Joost.

Reply by email

Marco van de Voort
to Joost van der Sluis
Show quoted text 10 lines
On Wed, 2007-01-17 at 10:33 +0200, Graeme Geldenhuys wrote: > Maybe we can add the following into FPC just to be compatible with Delphi? > > TDate = type TDateTime; > TTime = type TDateTime; I didn't even knew that Delphi has a TDate type. According to the Delphi-help it's the same at TDateTime, so for compatibility it can be added, yes. But I miss the point, why do they exist?

I'm not entirely sure, but afaik this is mostly for documentation purposes, to signal that only the date or time part is used.

Reply by email

Graeme Geldenhuys
to Joost van der Sluis: I didn't even knew that Delphi has a TDate type. According to the Delphi-help it's the…
Joost van der Sluis wrote
Delphi-help it's the same at TDateTime, so for compatibility it can be added, yes. But I miss the point, why do they exist?

I also expected them to be implemented differently to TDateTime, so was surprised to see they are exactly the same as TDateTime. I guess the best explanation is like what Marco said - for documentation purposes to show what part of the TDateTime is important. For example: DateOfBirth: TDate would make sense.

Graeme Geldenhuys There's no place like S34° 03.168' E018° 49.342'

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys
Graeme Geldenhuys wrote 10 lines
On 1/17/07, Joost van der Sluis wrote: > Delphi-help it's the same at TDateTime, so for compatibility it can be > added, yes. But I miss the point, why do they exist? I also expected them to be implemented differently to TDateTime, so was surprised to see they are exactly the same as TDateTime. I guess the best explanation is like what Marco said - for documentation purposes to show what part of the TDateTime is important. For example: DateOfBirth: TDate would make sense.

Nonono, this is not good if you want to create someones horoscope ;-)

Seriously:
I think the main reason is Delphi 1 compatibility. Delphi's TDateTime is based on Variant datetime stuff, which was a Win32 thing if I remember correctly. It probably obliviated the need for TDate and TTime.

Michael.

Reply by email