Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] Weird new time zone

From: "Dann Corbit" <DCorbit(at)connx(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>,"Oliver Jowett" <oliver(at)opencloud(dot)com>
Cc: "Magnus Hagander" <mha(at)sollentuna(dot)net>,"Hackers" <pgsql-hackers(at)postgresql(dot)org>,<pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: [HACKERS] Weird new time zone
Date: 2004-07-16 04:23:13
Message-ID: 54798A299E68514AB7C4DEBA25F03BE101BB81@postal.corporate.connx.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-hackers-win32
> -----Original Message-----
> From: pgsql-hackers-owner(at)postgresql(dot)org 
> [mailto:pgsql-hackers-owner(at)postgresql(dot)org] On Behalf Of Tom Lane
> Sent: Thursday, July 15, 2004 9:13 PM
> To: Oliver Jowett
> Cc: Magnus Hagander; Hackers; pgsql-hackers-win32(at)postgresql(dot)org
> Subject: Re: [pgsql-hackers-win32] [HACKERS] Weird new time zone 
> 
> 
> Oliver Jowett <oliver(at)opencloud(dot)com> writes:
> > How about scanning backwards until you have <= 1 choice or decide to
> > give up?
> 
> Hmm ... that really seems like not a bad idea.  Scan all the 
> available timezones, score each on how far back it goes 
> before a mismatch, take the one that goes furthest back.  I'm 
> not sure what to do about ties, nor what the minimum "passing 
> score" ought to be, but seems like the germ of an answer.  
> Comments anyone?

Use the Windows time zone inquiry function:

DWORD GetTimeZoneInformation(LPTIME_ZONE_INFORMATION
lpTimeZoneInformation);

// Where LPTIME_ZONE_INFORMATION is defined as:

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

The Bias parameter of the TIME_ZONE_INFORMATION structure is the
difference, in minutes, between UTC time and local time.

All translations between UTC time and local time are based on the
following formula:

UTC = local time + bias


Responses

pgsql-hackers by date

Next:From: Christopher Kings-LynneDate: 2004-07-16 04:26:07
Subject: Re: How to display privileges in psql
Previous:From: Tom LaneDate: 2004-07-16 04:13:09
Subject: Re: [HACKERS] Weird new time zone

pgsql-hackers-win32 by date

Next:From: Tom LaneDate: 2004-07-16 05:03:19
Subject: Re: [HACKERS] Weird new time zone
Previous:From: Tom LaneDate: 2004-07-16 04:13:09
Subject: Re: [HACKERS] Weird new time zone

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group