Link to home
Start Free TrialLog in
Avatar of Brigt
Brigt

asked on

convert TDate value from int to string or any other readable format

I use datetimepicker to select date, then this date is stored as double.
I think the format is TDate (days since 30 december 1899)
How can I convert this value back to a readable format.
Avatar of kode99
kode99

TDate is just a 'date only' TDateTime and has string functionality built in same as TDateTime.

So DateTimePicker1->Date.DateString() will give you a default date time string back.  Or if you need a specific arrangement use  DateTimePicker1->Date.FormatString("yyyy/mm/dd") - look up the TDateTime FormatString for the details on the specifiers you can use.
When I said 'default date time string' - I meant a default formatted date string.
Avatar of Brigt

ASKER

I have a variable under Private called int Date
after choosing a date with the datetimepicker, a set function is setting the value frome datetimepicker to int Date
typically 37000 something.
is it not possible to store the date as int and get it back as string?
Avatar of Brigt

ASKER

I have solved my problem.
Tdate is a class
TDate p;


StringGrid1->Cells [1] [n] = p.operator =(getDate());
ASKER CERTIFIED SOLUTION
Avatar of kode99
kode99

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Heh,  that's what i was talking about in the first post,

"TDate is just a 'date only' TDateTime and has string functionality built in same as TDateTime."
Why the C?

Are you aware of the grading guidlines at EE?
https://www.experts-exchange.com/help.jsp#hi73
Avatar of Brigt

ASKER

The grade I gave is reflecting the grade I got in at the end of the semester ;-)
No seriously I was in a hurry and did not take notice of the possibilities while giving you the grade. I will reconsider and post a nonsubject to see if anything can be done .
Thanks for your help and quick response