Here you can find the source of getTime(Date date)
public static String[] getTime(Date date)
//package com.java2s; /*L//from w w w .j av a2 s.c o m * Copyright Washington University in St. Louis, SemanticBits, Persistent Systems, Krishagni. * * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/wustl-common-package/LICENSE.txt for details. */ import java.util.Calendar; import java.util.Date; public class Main { public static String[] getTime(Date date) { String[] time = new String[2]; Calendar cal = Calendar.getInstance(); cal.setTime(date); time[0] = Integer.toString(cal.get(Calendar.HOUR_OF_DAY)); time[1] = Integer.toString(cal.get(Calendar.MINUTE)); return time; } public static String toString(Object obj) { if (obj == null) return ""; return obj.toString(); } }