Код: Выделить всё
public Date(long date)
Allocates a Date object and initializes it to represent the specified number of
milliseconds since the standard base time known as "the epoch", namely January 1, 1970,
00:00:00 GMT.
Код: Выделить всё
public static void main(String[] args) throws java.text.ParseException {
long milliSecFor25 = (24*60*60*24*1000);
long milliSecFor26 = (25*60*60*24*1000);
Date dateJan25 = new Date(milliSecFor25);
Date dateJan26 = new Date(milliSecFor26);
System.out.println("Date for Jan 25:" + dateJan25);
System.out.println("Date for Jan 26:" + dateJan26);
}
Код: Выделить всё
Date for Jan 25: Sun Jan 25 05:30:00 IST 1970
Date for Jan 26: Sun Dec 07 12:27:12 IST 1969
Подробнее здесь: https://stackoverflow.com/questions/221 ... onstructor
Мобильная версия