SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Convert UTC datetime to LocalTime Zone.


Convert UTC datetime to LocalTime Zone.

Author
Message
ghanshyam.kundu
ghanshyam.kundu
Right there with Babe
Right there with Babe (737 reputation)Right there with Babe (737 reputation)Right there with Babe (737 reputation)Right there with Babe (737 reputation)Right there with Babe (737 reputation)Right there with Babe (737 reputation)Right there with Babe (737 reputation)Right there with Babe (737 reputation)

Group: General Forum Members
Points: 737 Visits: 435
specially lowell, i will try to manipulate the code u have given to me.
TRACEY-320982
TRACEY-320982
SSCrazy
SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)

Group: General Forum Members
Points: 2994 Visits: 1014
Our SQL Server is in Pacific
Our Time Recording system is in GMT

For each timezone, I need to run a report at 10:00 in the employee timezone or it could be 8:00 just depends want I want to do the report.

So if i choose 10:00 for users in Pacific Time Zone, the run time on our app will run at 6 PM
Central 4 PM


Table
Time Zone
Central Standard Time US/Central -6.00 12/15/13 10:00 AM 12/15/13 4:00 PM 12/15/13 8:00 AM

How to pass in RunTime Expected time 10:00 and it to return the time GMT, and PCT, CT etc for all time zones.
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (205K reputation)SSC Guru (205K reputation)SSC Guru (205K reputation)SSC Guru (205K reputation)SSC Guru (205K reputation)SSC Guru (205K reputation)SSC Guru (205K reputation)SSC Guru (205K reputation)

Group: General Forum Members
Points: 205305 Visits: 41952
Sean Lange (9/6/2011)
That will work if all the users are in the same timezone as the server. Otherwise you will have to determine which timezone they are in.

Good point about the half hour. Isn't Newfoundland the only timezone where they do the funky half hour thing? I wonder how confusing time must be as a resident there when so many people forget.


IIRC, they've got some funky stuff with some half hour daylight savings time changes in some of the South Central states of the US.

And, yeah... I realize I responded to a 2 year old post. It still needed to be said.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
TRACEY-320982
TRACEY-320982
SSCrazy
SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)

Group: General Forum Members
Points: 2994 Visits: 1014
I figured my coding out
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search