Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.Calendar; public class Main { public static int[] getCurrentTime() { Calendar now = Calendar.getInstance(); now.setTimeInMillis(System.currentTimeMillis()); int[] time = new int[3]; time[0] = now.get(Calendar.HOUR_OF_DAY); time[1] = now.get(Calendar.MINUTE); time[2] = now.get(Calendar.SECOND); return time; } }