Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Date d = new Date(0L); what is 0L mean in this Date?

Tags:

java

date

Date d = new Date(0L); 

what is 0L mean in this Date d?

like image 736
jyo Avatar asked May 01 '11 12:05

jyo


People also ask

What does 0L mean in Python?

0L is a long integer value with all the bits set to zero - that's generally the definition of 0 .

What does 0L mean?

0L, abbreviation for 0 longitude, or the Prime meridian.

How can I set zero date in Java?

There is no Date 0/0/0, by definition, as there is no Day 0 and no Month 0. A day is a member of the set {1,..,28 or 30 or 31} and month is a member of the set {1,... 12}. Hence, it is impossible - and it is good that it is impossible - to express 0/0/0 as Date Object.


1 Answers

The 0L means the number zero of type long. It uses this constructor to instantiate a Date that refers to zero milliseconds after (i.e. exactly) "the epoch", January 1, 1970, 00:00:00 GMT.

like image 162
Matti Virkkunen Avatar answered Sep 26 '22 13:09

Matti Virkkunen