Skip to Content
0
Former Member
Jul 26, 2016 at 12:04 PM

Automatic DateTime conversion into local timezone with iOS SMP SDK

124 Views

Hi,

hoping someone can help me on this: Kenichi Unnai Claudia Pacheco Marvin HoffmannMidhun VP Ron Sargeant @Jeff Gebo

We are developing an iOS native app for a NetWeaver Gateway 7.4 SP10, SMP 3.0 SP08 and SMP 3.0 SDK SP09 PL01.

We are using the OnlineStore to read and create data.

In a particular OData service one entity has a property of type Edm.DateTime. We have the agreement that the time will be sent in UTC.

However, when we pass a NSDate() object into it, the server receives the property in the local time zone of the mobile device (GMT+2), not in UTC. We assume that the SMP SDK is doing this conversion automatically. We assume it is in the SODataConverter::setLocalTimeZone(...).

Is there a way to turn this off? Or force to send with UTC? As we would like to communicate in UTC between app and backend.

Details:
In the app we set the property as follows:

//create date and set property

let curDate = NSDate()

let prop = SODataPropertyDefault(name:"StartDate")

prop.value = curDate

properties.addObject(prop)

print(curDate) //"2015-07-02T08:00:00" which is UTC


But on the gateway we receive:

"Visit" : {
"StartDate" : "2015-07-02T10:00:00", //which is GMT+2, the device timezone
...

}

We assume that the SDK is doing this conversion which we would not like to have.