The following is driving me crazy, why am I getting the wrong calendar date when converting Unix Time 1386230874 using the code below!!
This should be Thu Dec 5 19:07:54 2013
Output:
Comment posted on:Sat Jan 17 11:03:50 EST 1970
Code:
Calendar facebook_created_time_calendar = Calendar.getInstance(TimeZone.getTimeZone("Australia/Sydney"));
facebook_created_time_calendar.setTimeInMillis(1386230874);
out.print("Comment posted on:");
out.println(facebook_created_time_calendar.getTime());