Reputation: 101
How to change the format 24-hour to 12-hour in Delphi 10.3 Rio in DBGridEh field?
I am trying to find one in the property of DBGridEh but no avail. Should I have to create a code for this or an override to system utils?
Upvotes: 0
Views: 3198
Reputation: 2755
Each column of DbGridEh has property "DisplayFormat". So you can use this property to set desired format acording his data type. For columns with datatypes TDateTime you can use :
dd.mm.yyyy hh.nn AM/PM
or
hh.nn.ss AM/PM
for example to set 12 hour format.
For more information about formatting a DateTime values see:
http://www.delphibasics.co.uk/RTL.asp?Name=formatdatetime
Edit:
As Ken White noted, you can also use TField.DisplayFormat
so no matter where the content of the field is displayed, it will have the same format.
Upvotes: 4