Andy Mark Tingey
Andy Mark Tingey

Reputation: 39

Date.getTime in Android Eclipse

Here is my code to assign a value to the Date:

long saveddatevalue = new Date().getTime();

I just want to know, what does this saved long variable actually show? I wish to use this to output values within a certain number of days.

Thanks!

Upvotes: 1

Views: 5585

Answers (2)

E-Riz
E-Riz

Reputation: 32954

It is far easier to work with java.util.Calendar.add(int, int) for manipulating dates. Here is some sample code.

Upvotes: 0

Jon Skeet
Jon Skeet

Reputation: 1502126

It will basically give you the same result as System.currentTimeMillis() - the number of milliseconds since the Unix epoch of midnight January 1st 1970, UTC.

Upvotes: 3

Related Questions