Aman
Aman

Reputation: 244

Configure SQL server to store UTC date Time

Is There some way to configure sql server to store UTC time in the database if passed local date time values??

Upvotes: 2

Views: 1617

Answers (1)

Oded
Oded

Reputation: 499132

No, there isn't.

You need to either convert to UTC before passing to SQL Server or after.

A DateTime instance that is passed in to SQL Server looses the associated DateTimeKind during the transfer, as the SQL type doesn't have anything corresponding to it.

Upvotes: 3

Related Questions