In SQL Server 2014 , how to convert given UTC date time to PST date time, when the server is in UTC
up vote
-1
down vote
favorite
How to convert given UTC date time to PST date time, by keeping the daylight stuff in time calculations?
Note that the server I am hitting is in utc. I mean, GETDATE() = GETUTCDATE()
.
Also, we can't use AT TIME ZONE
, as DB is on older SQL Server.
Thanks in advance for the help.
tsql sql-server-2014 utc
add a comment |
up vote
-1
down vote
favorite
How to convert given UTC date time to PST date time, by keeping the daylight stuff in time calculations?
Note that the server I am hitting is in utc. I mean, GETDATE() = GETUTCDATE()
.
Also, we can't use AT TIME ZONE
, as DB is on older SQL Server.
Thanks in advance for the help.
tsql sql-server-2014 utc
What version of SQL exactly? What makes you think we can suggest correct syntax if we don't know what version you are on?
– Nick.McDermaid
Nov 8 at 23:20
sorry it was sql server 2014
– RaturiMic
Nov 8 at 23:49
1
Possible duplicate of Convert Datetime column from UTC to local time in select statement
– user6655984
Nov 9 at 0:15
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
How to convert given UTC date time to PST date time, by keeping the daylight stuff in time calculations?
Note that the server I am hitting is in utc. I mean, GETDATE() = GETUTCDATE()
.
Also, we can't use AT TIME ZONE
, as DB is on older SQL Server.
Thanks in advance for the help.
tsql sql-server-2014 utc
How to convert given UTC date time to PST date time, by keeping the daylight stuff in time calculations?
Note that the server I am hitting is in utc. I mean, GETDATE() = GETUTCDATE()
.
Also, we can't use AT TIME ZONE
, as DB is on older SQL Server.
Thanks in advance for the help.
tsql sql-server-2014 utc
tsql sql-server-2014 utc
edited Nov 9 at 5:20
marc_s
565k12610921245
565k12610921245
asked Nov 8 at 22:57
RaturiMic
206
206
What version of SQL exactly? What makes you think we can suggest correct syntax if we don't know what version you are on?
– Nick.McDermaid
Nov 8 at 23:20
sorry it was sql server 2014
– RaturiMic
Nov 8 at 23:49
1
Possible duplicate of Convert Datetime column from UTC to local time in select statement
– user6655984
Nov 9 at 0:15
add a comment |
What version of SQL exactly? What makes you think we can suggest correct syntax if we don't know what version you are on?
– Nick.McDermaid
Nov 8 at 23:20
sorry it was sql server 2014
– RaturiMic
Nov 8 at 23:49
1
Possible duplicate of Convert Datetime column from UTC to local time in select statement
– user6655984
Nov 9 at 0:15
What version of SQL exactly? What makes you think we can suggest correct syntax if we don't know what version you are on?
– Nick.McDermaid
Nov 8 at 23:20
What version of SQL exactly? What makes you think we can suggest correct syntax if we don't know what version you are on?
– Nick.McDermaid
Nov 8 at 23:20
sorry it was sql server 2014
– RaturiMic
Nov 8 at 23:49
sorry it was sql server 2014
– RaturiMic
Nov 8 at 23:49
1
1
Possible duplicate of Convert Datetime column from UTC to local time in select statement
– user6655984
Nov 9 at 0:15
Possible duplicate of Convert Datetime column from UTC to local time in select statement
– user6655984
Nov 9 at 0:15
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Search the site, example: Convert Datetime column from UTC to local time in select statement
Read the link above, also include daylight stuff in there for some of the responses too.
yep yep yep .... thanks for the link noogen.
– RaturiMic
Nov 8 at 23:39
copied the query from @Aiden Kaskela : select CONVERT(datetime, SWITCHOFFSET(yourdate, DATEPART(TZOFFSET, yourdate AT TIME ZONE 'Pacific Standard Time')))
– RaturiMic
Nov 8 at 23:51
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Search the site, example: Convert Datetime column from UTC to local time in select statement
Read the link above, also include daylight stuff in there for some of the responses too.
yep yep yep .... thanks for the link noogen.
– RaturiMic
Nov 8 at 23:39
copied the query from @Aiden Kaskela : select CONVERT(datetime, SWITCHOFFSET(yourdate, DATEPART(TZOFFSET, yourdate AT TIME ZONE 'Pacific Standard Time')))
– RaturiMic
Nov 8 at 23:51
add a comment |
up vote
1
down vote
accepted
Search the site, example: Convert Datetime column from UTC to local time in select statement
Read the link above, also include daylight stuff in there for some of the responses too.
yep yep yep .... thanks for the link noogen.
– RaturiMic
Nov 8 at 23:39
copied the query from @Aiden Kaskela : select CONVERT(datetime, SWITCHOFFSET(yourdate, DATEPART(TZOFFSET, yourdate AT TIME ZONE 'Pacific Standard Time')))
– RaturiMic
Nov 8 at 23:51
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Search the site, example: Convert Datetime column from UTC to local time in select statement
Read the link above, also include daylight stuff in there for some of the responses too.
Search the site, example: Convert Datetime column from UTC to local time in select statement
Read the link above, also include daylight stuff in there for some of the responses too.
answered Nov 8 at 23:04
Noogen
1,29299
1,29299
yep yep yep .... thanks for the link noogen.
– RaturiMic
Nov 8 at 23:39
copied the query from @Aiden Kaskela : select CONVERT(datetime, SWITCHOFFSET(yourdate, DATEPART(TZOFFSET, yourdate AT TIME ZONE 'Pacific Standard Time')))
– RaturiMic
Nov 8 at 23:51
add a comment |
yep yep yep .... thanks for the link noogen.
– RaturiMic
Nov 8 at 23:39
copied the query from @Aiden Kaskela : select CONVERT(datetime, SWITCHOFFSET(yourdate, DATEPART(TZOFFSET, yourdate AT TIME ZONE 'Pacific Standard Time')))
– RaturiMic
Nov 8 at 23:51
yep yep yep .... thanks for the link noogen.
– RaturiMic
Nov 8 at 23:39
yep yep yep .... thanks for the link noogen.
– RaturiMic
Nov 8 at 23:39
copied the query from @Aiden Kaskela : select CONVERT(datetime, SWITCHOFFSET(yourdate, DATEPART(TZOFFSET, yourdate AT TIME ZONE 'Pacific Standard Time')))
– RaturiMic
Nov 8 at 23:51
copied the query from @Aiden Kaskela : select CONVERT(datetime, SWITCHOFFSET(yourdate, DATEPART(TZOFFSET, yourdate AT TIME ZONE 'Pacific Standard Time')))
– RaturiMic
Nov 8 at 23:51
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53217427%2fin-sql-server-2014-how-to-convert-given-utc-date-time-to-pst-date-time-when-t%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What version of SQL exactly? What makes you think we can suggest correct syntax if we don't know what version you are on?
– Nick.McDermaid
Nov 8 at 23:20
sorry it was sql server 2014
– RaturiMic
Nov 8 at 23:49
1
Possible duplicate of Convert Datetime column from UTC to local time in select statement
– user6655984
Nov 9 at 0:15