Java tutorial
//package com.java2s; import java.util.Calendar; public class Main { public static int[] formatTimeToArray(long time) { Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(time); int hour = cal.get(Calendar.HOUR_OF_DAY); int minute = cal.get(Calendar.MINUTE); return new int[] { hour, minute }; } }