Reputation: 165
In my application we storing the created datetime(In UTC) in database.This works correctly while running the application in the local machine,Same application run from azure nearly +2 min difference occurs from the local executed app.
Same issue occurs between Sql server(on-premise) and Azure Sql
Upvotes: 3
Views: 141
Reputation: 108400
a "+2 min difference" sounds like it may be due to differences in the system clocks between the two systems.
Your question doesn't specify the source of the " created datetime(in UTC) "
Is that from a database function, or from your application?
The most likely explanation for the behavior you observe is that system clocks on the two different systems are not synchronized using the same time service.
A four-dollar timex watch keeps better time than the hardware clock in a $4000 server. (I'm surprised the drift is only two minutes.) If you want the clocks on the two systems to match, there needs to be a mechanism to keep them synchronized with each other.
FOLLOWUP
I believe the answer above addressed the question you asked.
You may have some additional questions. I think the question you may be looking for an answer to might be... "How do I configure multiple Windows servers so the system clocks are synchronized?"
Some suggestions
etc.
Upvotes: 3