Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Time Zones

Author  Topic 

mfazio
Starting Member

17 Posts

Posted - 2006-12-11 : 09:48:04
I'm working on a subscription based service where users should be able to specify certain notification times where information will be sent to them. Id like this to be global, so i need to work with time zones.

What approach should i be taking?

E.G. Bob wants a notification sent to his email at 10AM GMT + 8 HOURS every day...

Thanks

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-12-11 : 09:49:57
From Books Online
quote:
GETUTCDATE
Returns the datetime value representing the current UTC time (Universal Time Coordinate or Greenwich Mean Time). The current UTC time is derived from the current local time and the time zone setting in the operating system of the computer on which SQL Server is running.

Syntax
GETUTCDATE()

Return Types
datetime

Remarks
GETUTCDATE is a nondeterministic function. Views and expressions that reference this column cannot be indexed.

GETUTCDATE cannot be called inside a user-defined function.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-12-11 : 19:36:52
quote:
Originally posted by mfazio

I'm working on a subscription based service where users should be able to specify certain notification times where information will be sent to them. Id like this to be global, so i need to work with time zones.

What approach should i be taking?

E.G. Bob wants a notification sent to his email at 10AM GMT + 8 HOURS every day...

Thanks



It is fairly easy to send notifications at times that are simple offsets to UTC time by using scheduled jobs. If you keep it to simple offsets to UTC, it will be a lot less work.

It will get a lot more complicated if you have to deal with daylight savings time vs. standard time for each individual location. For that, you will have to build a table of time zones, and a table that shows the start and end of daylight savings time for each year. If you need to deal with the whole world, it is a lot of work to maintain the time zone DST info.





CODO ERGO SUM
Go to Top of Page

mfazio
Starting Member

17 Posts

Posted - 2006-12-12 : 01:49:11
Well, if i only wish to deal with offsets, and not timezones... does anyone know of a list i can find the UTC offsets to bind to a drop down box?
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-12-12 : 03:01:20
http://en.wikipedia.org/wiki/List_of_time_zones


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -