Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Time confusion when porting to Win7?


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: Jul 28, 2016 12:29 AM Last Post By: Björn Schreiber
J Hviid

Posts: 8
Registered: 3/25/02
Time confusion when porting to Win7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 27, 2016 10:36 PM
I have just installed my D6 on a new Win7 laptop. (company policy stays at 32 bit 7, so far)

There are still a few issues, but I can now compile my applications.

But I have come across something strange with one of them. It has a simple digital clock shown on a panel. It works fine in 24 hour mode everywhere on XP.

On Win7, however, it goes American (AM/PM)!

It is not Delphi as such, because an EXE file compiled under XP does the same when run on the new laptop.
The laptop is set up to standard European 24-hour presentation, but I have seen other weird things around directories shown with other names that actually available on the HD.

Do I have to change my code to deal with this, or is there some hidden tweak i Win7?

Edited by: J Hviid on Jul 27, 2016 10:38 PM
Robert Triest

Posts: 687
Registered: 3/24/05
Re: Time confusion when porting to Win7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 28, 2016 12:12 AM   in response to: J Hviid in response to: J Hviid
It has a simple digital clock shown on a panel. It works fine in 24 hour mode everywhere on XP.
You should find out how this clock gets it's setting. (but i suppose you don't have the code..)
Maybe it can't use it's setting function anymore and it falls back to the default am/pm time.

Did you check the XP machine by changing the regional setting on American and does it change
the clock display also to am/pm? (You sure that the clock uses the regional settings of Windows?)
Björn Schreiber

Posts: 11
Registered: 10/7/06
Re: Time confusion when porting to Win7? [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 28, 2016 12:29 AM   in response to: J Hviid in response to: J Hviid
Am 28.07.2016 um 07:39 schrieb J Hviid:
On Win7, however, it goes American (AM/PM)!

This could be a well non problem with older Delphi versions:
http://qc.embarcadero.com/wc/qcmain.aspx?d=80189

In order to fix this, try to change your Windows language to any
other language and back to your preferred language. Or use the following
code at a central place, f.e. the initialization of a always used unit:

--- Schnipp On ---
SetThreadLocale(LOCALE_USER_DEFAULT);
GetFormatSettings;
--- Schnipp Off ---

but I have seen other weird things around directories shown with
other names that actually available on the HD.

This could be due to folder internationalisation / translating. F.e.
on my german Windows I see a directory called "Benutzer" (german for
"Users") in the Explorer while it is called "Users" when browsing in an
old Delphi 5 application. Try "dir" on a command prompt, there you will
see the real directory names.
If you use the common file dialogs (TOpenDialog, TSaveDialog) this
should work as expected, but not if you use old Delphi components like
TDirectoryListBox.

hth,
Björn
--
DRIGUS GmbH

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02