Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { final static String FORMAT_TIME = "HHmm"; public static String getTimeStringByCalendar(Calendar calendar) { SimpleDateFormat sdf = new SimpleDateFormat(FORMAT_TIME); final String timeString = sdf.format(calendar.getTime()) + "00"; return timeString; } }