Skip to main content
Solved

How to fix LastModifiedDateTime in the database?


We have LastModifiedDateTime in the database tables in the future. On the application level it’s correct.

Application Time

 

 

Database field time

 

Database collation is SQL_Latin1_General_CP1_CI_AS. Our location -  US, Central Time

Best answer by nadiyahnatyuk58

Found the solution:

SELECT LastModifiedDateTime  AT TIME ZONE 'UTC' AT TIME ZONE 'Central Standard Time' from SOLIne 

 

Thanks mbridges00 for your help!

View original
Did this topic help you find an answer to your question?

Forum|alt.badge.img+1
  • Jr Varsity II
  • July 11, 2024

The datetime in the database is typically stored as UTC. There’s a lot of logic taking place depending on timezone setup on the user, tenant, etc. that converts to/from UTC time to local time zone visible on the screen.


Found the solution:

SELECT LastModifiedDateTime  AT TIME ZONE 'UTC' AT TIME ZONE 'Central Standard Time' from SOLIne 

 

Thanks mbridges00 for your help!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings