tdatetime

Declare a TDateTime as a Const in Delphi

As far as I know there is no way to do this, but I am going to ask just in case someone else knows how to do this. How can I declare a date as a const in Delphi? The only solution I have found is to use the numeric equivalent, which is kind of a pain to maintain because it is not human readable. const Expire : TDateTime = 39895;...

Calculate time between 2 TDateTime, with a twist

I need to find out how to get the time between 2 times, but only if it is within work hours(Stored in a database) This is what I got for now, but it is totally wrong. the total won't bee correct. int __fastcall Organisasjon::CalculateResponsetimeInOpeninghours(std::auto_ptr<DBCommand> cmd, long orgid, TDateTime starttimeIn, TDateTime e...

Convert UTC string to TDatetime in Delphi

eg. var tm : string; dt : tdatetime; tm := '2009-08-21T09:11:21Z'; dt := ? I know I can parse it manually but I wonder if there is built-in function or win32 api function to do this ? Any help would be appreciated. ...

Frac function losing precision.

I have a TDateTime variable which is assigned a value at runtime of 40510.416667. When I extract the time to a TTime type variable using the Frac function, it sets it to 0.41666666666. Why has it changed the precision of the value and is there a workround to retain the precision from the original value ie. to set it to 0.416667. ...