What is the best way to store dates in Google App Engine as a back-end for both iOS and Android mobile apps?
In Android the way I like to store dates is using:
System.currentTimeMillis()
This makes it easy to put that date into a local SQLite database via a content provider.
This leads me to believe I should also store milliseconds as the date in all entities on Google App Engine. However, some code I have seen for Google App Engine stores dates using:
import java.util.date;
private Date createdDate;
In the constructor..:
this.createdDate = new Date();
This generates a date string which looks nice in Google App Engine's console:
However, I feel I should probably be storing all dates in Google App Engine in Long milliseconds so that everything is consistent.
Would it be a good idea to use only milliseconds in Google App Engine, Android and iOS to store dates so that everything is consistent across the board? Or is there another way to do this?
Aucun commentaire:
Enregistrer un commentaire