BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Saving Timezone Information in a database

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internationalization
View previous topic :: View next topic  
Author Message
Isaac Alexander
Guest





PostPosted: Mon Sep 22, 2003 8:08 pm    Post subject: Saving Timezone Information in a database Reply with quote



Does anyone know the best way to store timezone information in a MS SQL
Server database? What datatype(s) and sizes?

Thanks.


Back to top
Marc Scheuner
Guest





PostPosted: Tue Sep 23, 2003 6:51 am    Post subject: Re: Saving Timezone Information in a database Reply with quote



Quote:
Does anyone know the best way to store timezone information in a MS SQL
Server database? What datatype(s) and sizes?

if you look at the SQL Server Notification online help, you'll see a
timezone is defined by:

DaylightName Gets the daylight savings time name for the time zone.
DisplayName Gets the language-independent name for the time zone.
Language Gets the language for the time zone.
LocationName Gets the location name for the time zone.
StandardName Gets the standard time name for the time zone.
TimeZoneId Gets the identifier for the time zone.
TimeZoneName Gets the Notification Services-assigned name for the time
zone.
UtcOffset Gets the Universal Time Coordinate (UTC) offset value
for the time zone.

So you'd at least need five strings for the various names, not 100%
sure what to do about the language (store the name or a numeric ID?),
and at least two numeric values for the Time zone ID and the UTC
offset.

Additionally, you might want to add two more date fields for the
beginning and end of daylight savings time (if it's observed).

Marc
================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch


Back to top
Dr John Stockton
Guest





PostPosted: Tue Sep 23, 2003 10:33 am    Post subject: Re: Saving Timezone Information in a database Reply with quote



JRS: In article <3f6f5637 (AT) newsgroups (DOT) borland.com>, seen in news:borland
..public.delphi.internationalization, Isaac Alexander <isaaNOSPAMc@goproN
OSPAMcura.com> posted at Mon, 22 Sep 2003 13:08:01 :-

Quote:
Does anyone know the best way to store timezone information in a MS SQL
Server database? What datatype(s) and sizes?

Not really.

But you might like to note the following considerations.

Time Zones can be defined as -12 to +12; OTOH these days the Date Line
is rather bent, so the numbers need a little more range.

One must remember Summer Time.

Probably it is better to give the difference between recorded time and
GMT. For world compatibility, one needs I think a resolution of 1/4
hour, so that the difference would fit nicely into a signed byte. But
it would probably be wiser to used signed minutes, needing two bytes.

If the times are stored in GMT, it may not be necessary to store the
local version.

Alternatively, one might store the full local date-time, as a record of
what the clock/calendar showed then & there, and also the GMT, as a
record of the actual instant of recording.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internationalization All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.