Start a new topic

NSDate object on iOS development

My development is based on iOS and Backbone.js platforms. Mapping on iOS, kinvey format is



ISODate("YYYY-MM-DDThh:mm:ss.sssZ")



as Kinvey Guide expose. But, for backbone format all we have when persisting a date using moment.js library with toISODate() method is :



YYYY-MM-DDThh:mm:ss.sssZ



Because of different string format for the platforms, queries on IOS are not able to filter entities created from backbone platform e opposite too.



How is it the right way to proceed?




I cannot use $date (http://docs.mongodb.org/manual/reference/mongodb-extended-json/). I get this error:

{u'debug': u'An error has occurred within MongoDB while trying to execute your query', u'description': u'The Kinvey server encountered an unexpected error. Please retry your request', u'error': u'KinveyInternalErrorRetry'}

I have the same problem. How I can send a query for date using REST API while the date is in ISODate(xxx) format?
Date types are cross-platform compatible. You should store the date as a number or string in the database and convert them in your various clients.
Can anybody help me here? I can't understand why the NSDate object is saved on Kinvey database differently of javascript dates are.
Login or Signup to post a comment