Get time format from system ?

Thread Solved

Join Date: Jul 2007
Posts: 31
Reputation: claudiu_is is an unknown quantity at this point 
Solved Threads: 1
claudiu_is's Avatar
claudiu_is claudiu_is is offline Offline
Light Poster

Get time format from system ?

 
0
  #1
Feb 27th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 68
Reputation: jsosnowski is an unknown quantity at this point 
Solved Threads: 11
jsosnowski's Avatar
jsosnowski jsosnowski is offline Offline
Junior Poster in Training

Re: Get time format from system ?

 
0
  #2
Feb 27th, 2009
Take a look at Sysutils.pas. There a number of date/time methods that manage date operations.
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 3,200
Reputation: sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of 
Solved Threads: 571
Sponsor
sknake's Avatar
sknake sknake is offline Offline
.NET Enthusiast

Re: Get time format from system ?

 
0
  #3
Feb 27th, 2009
Isnt there a ShortTimeFormat global variable that defaults to the regional settings on the executing machine which you can then use or override?
Scott Knake
Custom Software Development
Apex Software, Inc.
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 31
Reputation: claudiu_is is an unknown quantity at this point 
Solved Threads: 1
claudiu_is's Avatar
claudiu_is claudiu_is is offline Offline
Light Poster

Re: Get time format from system ?

 
0
  #4
Feb 28th, 2009
Thank you for your sugestions, but I`ve choosed another solution:

  1. GetLocaleStr(GetThreadLocale(), LOCALE_STIMEFORMAT, '');

This returns "hh mm ss" or whatever the string timeformat from regional settings is.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Pascal and Delphi Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC