0
votes

From the docs it seems that the mobile backend starter will convert all datetime properties to strings when they are returned. This question also suggests that the datetime is stored as a string too (Sending and retreaving data from datastore with mobile backend starter). This is a real pain for filtering entities!

Which of the following workarounds is going to cause me less problems?

  1. Convert the date to milliseconds and save as an integer (long wont work for the same reasons as datetime). I dont mind loosing this level of accuracy and I dont need dates past 2038
  2. retrieve all the entries on every call and filter these in the app - waste of data transfer
  3. an option I haven't thought of?
1

1 Answers

0
votes

Look into Cloud Endpoints. The link you provide no longer works and the "Mobile Backend Starter" is no longer online. In a Cloud Endpoints API (this example is for python), you can make use of DateTimeField on a Message object returned from your Endpoints API method. There will be no need to worry about data type conversion, as this is handled by the generated client library. Please make good use of the docs and reference them often while you are learning about and developing your Cloud Endpoints API.

After answering your question, I'll also give this advice: you should strive to be coding in a way where you can look up a tool and find out yourself how to use it, instead of relying on patching "sample apps" that people make. When you work in this way, you don't have to worry about sample code being taken down, copy-pasted snippets not working for reasons you don't understand, etc...

Good luck with your projects!