If you use Delphi's DatePicker component, you'll see that it displays the year just like your DBGrids, so the problem has nothing to do with the database engine. But when you set Windows' Regional Settings to display dates as mm/dd/yyyy and next start a Delphi application, date fields are displayed as mm/dd/yyyy. Problem solved? No, the user surely won't appreciate it if you enforce him to change his Windows settings, resulting in problems in other applications...
If your application shows dates and/or floating point numbers, set the global formatting variables ShortDateFormat, DecimalSeparator, LongDateFormat, and so on... to the desired values. Do this right after the start of your application, for example in the OnCreate event handler of the main form.
A project with examples of this technique is contained in the zip-file DFORMAT.ZIP in the Download section, under the heading Mini Tutorial Projects.
TOP FAQ Crash Course Delphi Tips Source Code Downloads Links
© Copyright 1999-2019