The Unix timestamp
is 1417029117
, which is 11/26/2014, Wednesday.
long timestamp = 1417029117l*1000l;
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(timestamp);
System.out.println("current day is "+cal.get(Calendar.DAY_OF_WEEK));
System.out.println("current month is "+cal.get(Calendar.MONTH));
And I got the results as follows:
current day is 4
current month is 10
Any explanation? If January is 0
then the month is fine. But why the day is 4
?