Tuesday, May 28, 2013

Java: convert from Long milliseconds to calendar object

Long myLong = entity.getPurchaseOrderDateMilliseconds();// returns 1369717200000
Timestamp timestamp = new Timestamp(myLong);
Calendar calendar = GregorianCalendar.getInstance();
calendar.setTimeInMillis(timestamp.getTime());        

No comments: