943,724 Members | Top Members by Rank

Ad:
Feb 27th, 2009
0

Get time format from system ?

Expand Post »
Hi,
Does anybody know how can I return the time format from the system regional settings ?
I need something like "hh mm ss" returned ( or whatever the current system time format is) to pass it as argument for FormatDateTime() function along with a given time;
I`m using Delphi 6.
Thanks.
Similar Threads
Reputation Points: 10
Solved Threads: 1
Light Poster
claudiu_is is offline Offline
40 posts
since Jul 2007
Feb 27th, 2009
0

Re: Get time format from system ?

Take a look at Sysutils.pas. There a number of date/time methods that manage date operations.
Reputation Points: 11
Solved Threads: 11
Junior Poster in Training
jsosnowski is offline Offline
68 posts
since Nov 2007
Feb 27th, 2009
0

Re: Get time format from system ?

Isnt there a ShortTimeFormat global variable that defaults to the regional settings on the executing machine which you can then use or override?
Featured Poster
Reputation Points: 1749
Solved Threads: 735
Senior Poster
sknake is offline Offline
3,948 posts
since Feb 2009
Feb 28th, 2009
0

Re: Get time format from system ?

Thank you for your sugestions, but I`ve choosed another solution:

delphi Syntax (Toggle Plain Text)
  1. GetLocaleStr(GetThreadLocale(), LOCALE_STIMEFORMAT, '');

This returns "hh mm ss" or whatever the string timeformat from regional settings is.
Reputation Points: 10
Solved Threads: 1
Light Poster
claudiu_is is offline Offline
40 posts
since Jul 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Pascal and Delphi Forum Timeline: Decimal to Binary or hex
Next Thread in Pascal and Delphi Forum Timeline: reading more than one line from text file





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC