getting the system time format 
Author Message
 getting the system time format

hey all,

Anyone know how to get the Windows system time format. Like if the user has
it setup to display in 24 hour mode, 12 hour mode, etc...

thanks in advance for any help!

-matt



Mon, 26 Jan 2004 03:06:03 GMT  
 getting the system time format

Quote:
> Anyone know how to get the Windows system time format. Like if the user
has
> it setup to display in 24 hour mode, 12 hour mode, etc...

You are looking for the

GetDateFormat() and GetTimeFormat() functions.

Regards

James



Mon, 26 Jan 2004 03:21:27 GMT  
 getting the system time format
By using the GetLocaleInfo(..) API function.

Cheers
Check Abdoul
--------------------


Quote:
> hey all,

> Anyone know how to get the Windows system time format. Like if the user
has
> it setup to display in 24 hour mode, 12 hour mode, etc...

> thanks in advance for any help!

> -matt



Mon, 26 Jan 2004 03:22:56 GMT  
 getting the system time format
thats what i thought too, but the documentation for GetTimeFormat says that
it actually formats a SYSTEMTIME object with the given format, or the user's
local settings based on what flags are passed in.

maybe they shoulod rename that method so the name matches functionality?

-matt

Quote:

> > Anyone know how to get the Windows system time format. Like if the user
> has
> > it setup to display in 24 hour mode, 12 hour mode, etc...

> You are looking for the

> GetDateFormat() and GetTimeFormat() functions.

> Regards

> James



Mon, 26 Jan 2004 03:37:10 GMT  
 getting the system time format

Quote:
> > > Anyone know how to get the Windows system time format. Like if the
user
> > > has
> > > it setup to display in 24 hour mode, 12 hour mode, etc...

> > You are looking for the

> > GetDateFormat() and GetTimeFormat() functions.
> thats what i thought too, but the documentation for GetTimeFormat says
that
> it actually formats a SYSTEMTIME object with the given format, or the
user's
> local settings based on what flags are passed in.

> maybe they shoulod rename that method so the name matches functionality?

But this should work, doensn't it?

GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, sTime, 15);

Or maybe I understood you wrong...

James



Mon, 26 Jan 2004 04:55:36 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Getting or Setting regional settings for date/time format from an application

2. getting and useing system time

3. getting system time on NT

4. Getting system time

5. getting wrong system time

6. Getting idle time of system/os

7. Getting system date/time at midnight?

8. runtime needed (getting system time?)

9. Getting system time from an NT server

10. Getting current system time in milliseconds

11. Minimum Wait Time (System Time Resolution)

12. Correct time counting when system time is changing

 

 
Powered by phpBB® Forum Software