I am using Parse back-end, and i have a Date field which i need to fill with Server time. But i am updating this from Android-SDK and i want to update it with server time. (I don't want to take local time from mobile and convert as it is not reliable, may be if the user's time was wrong)
Asked
Active
Viewed 1,302 times
0
-
1you need to use UTC time format . go through this url http://stackoverflow.com/questions/2818086/android-get-current-utc-time – dharmendra May 27 '14 at 07:54
1 Answers
1
You can use beforeSave cloud method hook for such scenarios.
Parse.Cloud.beforeSave("YourClassName", function(request, response) {
request.object.set("yourDateField", new Date());
response.success();
});
This will set "yourDateField" with the server time stamp (GMT) before inserting the row into the Class.

Srijith Vijayamohan
- 905
- 6
- 18