Android examples for java.util:Millisecond
Gets hour of day from milliseconds.
//package com.java2s; import java.util.Calendar; public class Main { /**/*ww w. ja v a 2 s . c om*/ * Gets hour of day from milliseconds. * @param milliSeconds Timestamp in milliseconds. * @return Hour of day. */ public static int getHourFromMilliseconds(Long milliSeconds) { Calendar time = Calendar.getInstance(); time.setTimeInMillis(milliSeconds); return time.get(Calendar.HOUR_OF_DAY); } }