I cant get this right and wonder how to show the Firestore FieldValue.serverTimestamp()
formatet individual depending on what local
the device has.
The Firestore timestamp
look like this
Sat Mar 10 19:42:32 GMT+01:00 2018
try {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS", Locale.getDefault());
Date parsedDate = dateFormat.parse("Sat Mar 10 19:42:32 GMT+01:00 2018");
txtCreationDate.setText(new Date(parsedDate.getTime()).toString());
} catch (ParseException e) {
txtCreationDate.setText("time error");
}
If one user i USA create the date time object then if another user i Italy view it then the creation time must adjusted to his clock
I have read many pages about this but the dateFormat parser give me error only.
Please advice