Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Float to DateTime conversion

Status
Not open for further replies.

barnarp

Programmer
May 7, 2002
16
ZA
Hi,

How can I convert the float value .983333333333333 to be equal to the date value (hh:mm) of 00:59?

Regards
 
Not sure what you are trying to do, as from the help.
'fractional part of the TDateTime value is fraction of a 24 hour day that has elapsed.'

So if you pass your value to
Timetostr(0.983333333333333);
you get 23:36:00 which is almost a full day as you would expect.




[red]GNBM 4th Feb[/red] More on and other neat UK stuff at forum1091
Steve: Delphi a feersum engin indeed.
 
Multiply it by sixty to give you the 59 part, then throw that into the appropriate parameter of the EncodeTime function. See the Delphi help for details.

It may help us if you explained exactly what you are trying to achieve.

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top