I have a model with the following structure
public class OfferModel {
private String mImageUrl;
private String mOfferCode;
private String mOffe
Use ISO 8601 date format:
SimpleDateFormat ISO_8601_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:sss'Z'");
String now = ISO_8601_FORMAT.format(new Date());
Representing Date as a String has two greater advantages:
"2018-03-30T13:18:39.516Z" vs 1522415925281)new Date("2018-03-30T13:18:39.516Z") This is quite useful if you have Android and browsers both consuming Firebase data.