My timestamp returns Timestamp(seconds=1560523991, nanoseconds=286000000)
in a Flutter Firestore snapshot.
I want to print it as properly formatted date and
I found Ashutosh's suggestion gives more user friendly output. A function like this is recommended in a helper class with a static method.
static convertTimeStamp(Timestamp timestamp) {
assert(timestamp != null);
String convertedDate;
convertedDate = DateFormat.yMMMd().add_jm().format(timestamp.toDate());
return convertedDate;
}
Intl package is require for DateFormat
.