I am using a VCL forms application in C++ Builder.
How can I get just the date from a TDateTime object that has both a date and a time associated with it?
Here is an example:
TDateTime test("25/09/2012 12:00am");
I am after a TDateTime object that has just the following information:
"25/09/2012"
Thanks
You can use
DateOfHowever, note that it will return
"25/09/2012 00:00"asTDateTimetype includes the time, so if you really needTDateTimereturned you can’t avoid the hour:minute info.If you want to extract day/month/year info from
TDateTimeyou can useDecodeDatefunction