I want to display the date of a trip. In the application several trips are listed, each has a long value with the currentTimeMillis of its generation. I want to turn this long number into a date but the output is always something around 1970... Is System.currentTimeMillis() the right way to store the time of the trip generation?
Date date = new Date(trip.getStartTime()); // 195342322
SimpleDateFormat test = new SimpleDateFormat("yyyy-MM-dd");
startTime.setText(String.valueOf(test.format(date)));
-> Output of startTime: 1970-01-01