Automatically Convert DateTime Object to Azure Mobile Services

I have an Azure Mobile Service with a .NET backend. I am using ApiController

which creates an object DateTime

and returns it to a .NET client (specifically a Windows Phone app).

When this one DateTime

, returned as part of an object, is returned to the client, the time is automatically converted to a different time. It looks like Azure assumes it DateTime

is in Utc format and tries to convert it to local time.

I don't want this to happen because it DateTime

should be the same for everyone using the application and therefore converting to local time is not desirable.

I tried to explicitly try to get Azure not to convert the date by trying something like this:

dateTime = DateTime.SpecifyKind(dateTime, DateTimeKind.Unspecified);

      

However, this has no effect.

How can I ensure that the objects DateTime

returned by Azure Mobile Services from the .NET backend are not converted when returned to the .NET client?

+3
c # datetime azure azure-mobile-services


source to share


No one has answered this question yet

Check out similar questions:

1991
Convert string to date and time
696
How can I convert a Unix timestamp to DateTime and vice versa?
622
DateTime vs DateTimeOffset
538
Convert string to DateTime
516
Converting date to datetime in Python
288
Convert UTC / GMT time to local time
1
Azure App Service - DateTime changes during sync
0
How do I download an Azure Mobile Services test?
0
Desktop Controller - Azure Mobile Services.Net backend not refundable
0
Store the DateTime so you can query in Azure Mobile Services (Javascript)



All Articles
Loading...
X
Show
Funny
Dev
Pics