-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
  • 11,496
  • 11
  • 63
  • 74

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
  • 467
  • 4
  • 6