Answered by:
Date time with created date column

Question
-
Hi,
My SQl server management studio have the pacific time zone. so when i create a table, with created date, modified date column with getdate(). it returns date of current time pacific time.
My requirement is created date, modified date need to show the the US Eastern day light saving time(EST) with datetime datatype.
Please anyone suggest the Sql query for this.
Regards,
Priviya.P
Monday, June 24, 2019 10:20 AM
Answers
-
SELECT create_date AT TIME ZONE 'US Eastern Standard Time'
FROM tblBest Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting: Large scale of database and data cleansing
Remote DBA Services: Improves MS SQL Database Performance
SQL Server Integration Services: Business Intelligence
- Proposed as answer by Cathy JiMicrosoft contingent staff Tuesday, June 25, 2019 8:08 AM
- Marked as answer by Ed Price - MSFTMicrosoft employee Thursday, August 8, 2019 1:12 AM
Tuesday, June 25, 2019 5:53 AM -
Hi Priviya.P,
Using AT TIME ZONE clause converts it into the target time zone using the time zone conversion rules.
Please refer to AT TIME ZONE (Transact-SQL).
Best regards,
CathyMSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com- Marked as answer by Ed Price - MSFTMicrosoft employee Thursday, August 8, 2019 1:12 AM
Tuesday, June 25, 2019 8:12 AM
All replies
-
SELECT create_date AT TIME ZONE 'US Eastern Standard Time'
FROM tblBest Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting: Large scale of database and data cleansing
Remote DBA Services: Improves MS SQL Database Performance
SQL Server Integration Services: Business Intelligence
- Proposed as answer by Cathy JiMicrosoft contingent staff Tuesday, June 25, 2019 8:08 AM
- Marked as answer by Ed Price - MSFTMicrosoft employee Thursday, August 8, 2019 1:12 AM
Tuesday, June 25, 2019 5:53 AM -
Hi Priviya.P,
Using AT TIME ZONE clause converts it into the target time zone using the time zone conversion rules.
Please refer to AT TIME ZONE (Transact-SQL).
Best regards,
CathyMSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com- Marked as answer by Ed Price - MSFTMicrosoft employee Thursday, August 8, 2019 1:12 AM
Tuesday, June 25, 2019 8:12 AM