-3

I need to create a timestamp with interval of 1 day this is the right way ?

long day = 1000 * 60 * 60 * 24;     
Date date = new Date();
Timestamp stamp = new Timestamp(date.getTime() + day);

And the other question is how can i format the timestamp to get the formated time like this:

22 hours and 31 minute and 1 seconds lefts.

DimaSan
  • 12,264
  • 11
  • 65
  • 75

1 Answers1

0

I think you can just store System.currentTimeMillis() + TimeUnit.DAYS.toMillis(1) as a long into your collection.

A good example to format your time is here.

Cedric
  • 532
  • 5
  • 7