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!

DateTime

Status
Not open for further replies.

MLNorton

Programmer
Nov 15, 2009
134
US
How can I get the numerical date value of a specific date such as 1 Jan 2012?
 
What do you mean? A TDateTime is a float value. Trunc(DateTimeVariable) will give you just the date portion of a TDateTime.
 
I know that but I can not find a function that will give me this float value for a date I specify.
 
Code:
procedure TForm30.Button1Click(Sender: TObject);
var
    MyDate: TDateTime;
    MyFloat: Double;
begin
    MyDate := EncodeDate(2011,1,1);
    MyFloat := MyDate;
    ShowMessage(FloatToStr(Myfloat));
end;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top