Mobile Bug: Date to DateTime

Good morning Community

I came across the following problem in mobile, service studio 10.0.910.0, when assigning a date value to a datetime variable, it is adding an hour. Example: # 1985-11-22 # when assigning the value is # 1985-11-22 01: 00: 00 #

Has anyone gone through this?

Hello Carlos.

When you send data from mobile to server (and back), the data time is converted based on the server/device time settings. So if your device is in GMT and the server in GMT+1, when you send your date time, it will add one hour, and when you receive it back, it will be converted back to your device setting. 

Could be that?

One way to stop this is to send Date and Time separately.

Cheers.

Hello Eduardo
I think that's right, I converted the date to text and concatenated the hours # 00: 00: 00 # and then I converted from text to datetime and it worked.

I would just send the date in a Date attribute/variable and the time in a Time attribute/variable. This should be enough, without the overhead of converting to text and back.

Cheers.

Afaik, the cloud servers run on UTC. In general, assigning a date to a datetime might not be a good idea. Eduardo's solution is better.

Edit: Just saw the question is about mobile. The local database on a mobile device is also in utc, so sending data to/from a mobile device to a cloud server shouldn't cause conversion.