I need to be able to consider time-zones, including daylight savings, within
stored procedures. Can anyone point me to a resource/code base which will
either allow me to procure or build my own code? I need to do things like
determine local time based on a customer's state, zip code, city, or whateve
r
is required to truly determine the customer's local time.
Thanks,
Michael"Snake" <Snake@.discussions.microsoft.com> wrote in message
news:20421547-C406-4AA1-8E4A-FEF5012FCE5E@.microsoft.com...
>I need to be able to consider time-zones, including daylight savings,
>within
> stored procedures. Can anyone point me to a resource/code base which will
> either allow me to procure or build my own code? I need to do things like
> determine local time based on a customer's state, zip code, city, or
> whatever
> is required to truly determine the customer's local time.
> Thanks,
> Michael
You are in for a heap of work. Especially if you need to go international.
Just a couple of notes. Daylight savings time is done differently in
different countries. IIRC, the US currently switches on the last Sunday in
October and the first Sunday in April. England switches on the last Sunday
in October and the last Sunday in March.
Some countries require a minium of 150 days of daylight savings time, so
they have different schedules every year.
If you only need to do the US, then you will need to create a stack of
lookup tables for state, zip codes and cities. You will need logic to
default if the zip code or city doesn't exist. You will need to keep in
mind also that some states like Tennesse and Texas have multiple time zones.
You will need to keep in mind that Arizona and Hawaii don't do daylight
savings time and part of Indiana doesn't either.
Google for daylight savings time and you will find a number of articles
regarding this issue.
Good luck!
Rick Sawtell|||> Just a couple of notes. Daylight savings time is done differently in
> different countries. IIRC, the US currently switches on the last Sunday
> in October and the first Sunday in April.
And to add to the fun, that changes next year!
A|||I just posted this the other day for similar question here:
http://channel9.msdn.com/ShowPost.aspx?PostID=142586
Client would still need to pass it's standard time zone name to the proc or
you could have that data stored in a table by user.
William Stacey [MVP]
"Snake" <Snake@.discussions.microsoft.com> wrote in message
news:20421547-C406-4AA1-8E4A-FEF5012FCE5E@.microsoft.com...
>I need to be able to consider time-zones, including daylight savings,
>within
> stored procedures. Can anyone point me to a resource/code base which will
> either allow me to procure or build my own code? I need to do things like
> determine local time based on a customer's state, zip code, city, or
> whatever
> is required to truly determine the customer's local time.
> Thanks,
> Michael
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment