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.

Recommended Answers

All 3 Replies

Take a look at Sysutils.pas. There a number of date/time methods that manage date operations.

Isnt there a ShortTimeFormat global variable that defaults to the regional settings on the executing machine which you can then use or override?

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

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

This returns "hh mm ss" or whatever the string timeformat from regional settings is.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.