Skip to main content
Answer

How to fix LastModifiedDateTime in the database?

  • July 11, 2024
  • 2 replies
  • 65 views

Forum|alt.badge.img

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!

2 replies

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.


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • Answer
  • July 11, 2024

Found the solution:

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

 

Thanks mbridges00 for your help!