Change date format in TGrid

Hi there,

I am trying to migrate one of my applications, which was originally developed with a Paradox database, to Microsoft SQL Express 2012.
Therefore, I am using Ado components, shipped within my Delphi 7 environment.

Unfortunately the date formats, as displayed in the TGids controls, is changed. Before I saw a date formatted as "dd-mm-yyyy". Now it is "yyyy-mm-dd".

Which options do I have to change this data format in TGrid?

Kind Regards,
Stefan
Stefan van RoosmalenTeamleader Service DeskAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Geert GOracle dbaCommented:
the date format shown is dependant of the user os settings
for windows this is the control panel, language and country settings

specific countries have specific settings
> changing those will give you different output
0
Tony303Commented:
If the above doesn't work, then you may need to cast or convert the date, for every view/query.

Here is an Experts Exchange thread....

http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SQL-Server-2005/Q_24646514.html
0
Sinisa VukSoftware architectCommented:
Is this TDBGrid maybe?
You can change dataset field display format:
TDateTimeField(data.fieldByName('your_field')).DisplayFormat:='dd-mm-yyyy';

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.