Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wrong date and time format

Status
Not open for further replies.

auditdi30

Programmer
Feb 25, 2009
39
NO
Hello!

Have installed bde 5.2 in windows7, and my software is making in Delphi7.

But when shows the time and date, it is in wrong format for my country. Time it show 7:52:33 PM, and I should have been 19:52:33. Date it show 1/25/2010 but should have been 25.01.2010. It shows right in the right lower corner of the screen, but not in my application. What can be wrong?? When I use the same application in windows Xp it is correct!

TIA
Kåre!
 
D7 is not correctly handling the new way of Vista and Windows 7 way of Locale and corresponding stuff. The first time you started Delphi 7, you got a big warning that it's not fully compatible (Windows knows about that ;-)) In later versions of Delphi that got fixed (can't tell which version though, I don't have them), but you could use an explicit format string for your date and time display.

HTH
 
You can also set the date format global variables so that you don't have to supply the format in each of your routines.
 
Thanks for answer!

I found the solution from someone else on the internet. Just change the region to a different one, and then back to mine, then it works fine.
It was a problem with Windows 7 I understand.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top