Reputation:
I have a field in my database called 'Times', it's a date/time format and its format is set to 'short time'. In my database the date does not show, nor is it being add to the database as I know. It is only the time value. My DBGrid shows the time field with the time value and the date '12/30/1899'. How do I get rid of the date in my time field.
Here is the code I used to submit to the database. Get time value:
bookingtimes:= timeof(dttime.Time);
Submit to Database:
tblbooking.FieldByName('Times').AsDateTime:=bookingtimes;
Example of DBGrid 'Times' column output:
12/30/1899 7:02:01AM
Upvotes: 0
Views: 3968
Reputation: 14928
If I understand what you mean this will work for you, just follow this steps:
Times
field:Object Inspector
and find DisplayFormat
property:format
, in your case hh:mm:ss
:That's it.
Upvotes: 5