I want to set a DateTime every time that I make an entry and show it. I'm not able to show the right DateTime. It shows me 1st January 1970 + HH MM and SS. The idea is every time I make an entry, it will print the DateTime this entry was made, like a history.
Here my code:
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
FirebaseEntry xx= mDataset.get(position);
Date date = new Date(Long.parseLong(xx.getDate()));
DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
String dateInCorrectFormat = (dateFormat.format(date));
holder.mDate.setText(dateInCorrectFormat);
}
Thanks for the help.