1. TZ

Hello All.

Does anyone know how I can get the timezone from the user's computer?


Thanks

Rob S.

new topic     » topic index » view message » categorize

2. Re: TZ

>Hello All.
>
>Does anyone know how I can get the timezone from the user's computer?
>

How about using the Win API function

DWORD GetTimeZoneInformation(
LPTIME_ZONE_INFORMATION lpTimeZoneInformation);

where lpTimeZoneInformation points to a TIME_ZONE_INFORMATION struct:

typedef struct _TIME_ZONE_INFORMATION { // tzi
    LONG       Bias;
    WCHAR      StandardName[ 32 ];
    SYSTEMTIME StandardDate;
    LONG       StandardBias;
    WCHAR      DaylightName[ 32 ];
    SYSTEMTIME DaylightDate;
    LONG       DaylightBias;
} TIME_ZONE_INFORMATION;

Where Bias is the differance between the local time and the Coordinated 
Universal Time (UTC).
StandardDate Specifies a SYSTEMTIME structure that contains a date and UTC 
when the transition from daylight time to standard time occurs on this 
operating system. And vice versa for DaylightDate. I assume that by standard 
time and daylight time they mean winter time and summer time.
SYSTEMTIME looks like this:

typedef struct _SYSTEMTIME {  // st
    WORD wYear;
    WORD wMonth;
    WORD wDayOfWeek;
    WORD wDay;
    WORD wHour;
    WORD wMinute;
    WORD wSecond;
    WORD wMilliseconds;
} SYSTEMTIME;

new topic     » goto parent     » topic index » view message » categorize

3. Re: TZ

Thanks but is there an easier way of doing this?
I am a novice and by the looks of it, it uses the registry.
I dont want to any includes.

But if there isn't a way i guess I'll get it working whit what you provided.


Thanks.

new topic     » goto parent     » topic index » view message » categorize

4. Re: Re: TZ

--part1_66.208fb508.2a0666c0_boundary

Hello Chris,

Why I don't want to use includes:

1.  I don't know how to use API calls.

2.  It is meant to be a stand-alone file. It is a date library that can 
display the date in many different formats (Ex.  5/5/2002;  May 5, 2002; etc) 
and i was hoping for it to not require any includes to function.  I want it 
to be compatible with windows and dos.


But since what I need is only in the registry and I dont know how to use API 
calls, do you know the path to it?
I'll just make two seperate versions.


Thanks.

Rob S.

P.S.
       If I am not making sense to you please note that I am fairly new to 
EU.

--part1_66.208fb508.2a0666c0_boundary
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: 7bit

<HTML><FONT FACE=arial,helvetica><FONT  SIZE=2>Hello Chris,<BR>
<BR>
Why I don't want to use includes:<BR>
<BR>
</FONT><FONT  COLOR="#000080" style="BACKGROUND-COLOR: #ffffff" SIZE=2
FAMILY="SANSSERIF" FACE="Arial" LANG="0"><B>1.&nbsp; </FONT><FONT 
COLOR="#000000" style="BACKGROUND-COLOR: #ffffff" SIZE=2 FAMILY="SANSSERIF"
FACE="Arial" LANG="0"></B>I don't know how to use API calls.<BR>
<BR>
</FONT><FONT  COLOR="#000080" style="BACKGROUND-COLOR: #ffffff" SIZE=2
FAMILY="SANSSERIF" FACE="Arial" LANG="0"><B>2.&nbsp; </FONT><FONT 
COLOR="#000000" style="BACKGROUND-COLOR: #ffffff" SIZE=2 FAMILY="SANSSERIF"
FACE="Arial" LANG="0"></B>It is meant to be a stand-alone file. It is a date
library that can display the date in many different formats (Ex.&nbsp;
5/5/2002;&nbsp; May 5, 2002; etc) and i was hoping for it to not require any
includes to function.&nbsp; I want it to be compatible with windows and dos.<BR>
<BR>
<BR>
But since what I need is only in the registry and I dont know how to use API
calls, do you know the path to it?<BR>
I'll just make two seperate versions.<BR>
<BR>
<BR>
Thanks.<BR>
<BR>
Rob S.<BR>
<BR>
P.S.<BR>

--part1_66.208fb508.2a0666c0_boundary--

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu