Reputation: 2111
How can you know which hour/timezone is used on azure (within a worker role for instance) ? how does it work when servers are loadbalanced ? Would you use some kind of ntp server to synchronize instead ?
Upvotes: 2
Views: 1713
Reputation: 1221
I created service in Azure and code snippet to get actual Azure time
http://azuretime.azurewebsites.net/datetimeoffset
private async Task<DateTimeOffset> GetAzureTimeAsync()
{
using(var client = new HttpClient())
{
return DateTimeOffset.Parse(await client.GetStringAsync("http://azuretime.azurewebsites.net/datetimeoffset")).ToUniversalTime();
}
}
Upvotes: 0
Reputation: 521
Azure servers all run on UTC Time. See http://blogs.msdn.com/b/ericgolpe/archive/2010/12/29/windows-azure-date-time-and-locale.aspx for more information.
Upvotes: 6