Mar 5, 2012 #1 MLNorton Programmer Nov 15, 2009 134 US How can I get the numerical date value of a specific date such as 1 Jan 2012?
Mar 5, 2012 #2 DjangMan Programmer Jun 1, 2001 1,783 CA What do you mean? A TDateTime is a float value. Trunc(DateTimeVariable) will give you just the date portion of a TDateTime. Upvote 0 Downvote
What do you mean? A TDateTime is a float value. Trunc(DateTimeVariable) will give you just the date portion of a TDateTime.
Mar 6, 2012 Thread starter #3 MLNorton Programmer Nov 15, 2009 134 US I know that but I can not find a function that will give me this float value for a date I specify. Upvote 0 Downvote
Mar 6, 2012 #4 DjangMan Programmer Jun 1, 2001 1,783 CA Code: procedure TForm30.Button1Click(Sender: TObject); var MyDate: TDateTime; MyFloat: Double; begin MyDate := EncodeDate(2011,1,1); MyFloat := MyDate; ShowMessage(FloatToStr(Myfloat)); end; Upvote 0 Downvote
Code: procedure TForm30.Button1Click(Sender: TObject); var MyDate: TDateTime; MyFloat: Double; begin MyDate := EncodeDate(2011,1,1); MyFloat := MyDate; ShowMessage(FloatToStr(Myfloat)); end;
Mar 6, 2012 Thread starter #5 MLNorton Programmer Nov 15, 2009 134 US Problem solved. Thanks. Upvote 0 Downvote