Here you can find the source of getDate(Calendar calendar)
public static HashMap<String, Object> getDate(Calendar calendar)
//package com.java2s; //License from project: BEER-WARE LICENSE import java.util.Calendar; import java.util.HashMap; public class Main { public static final String YEAR = "year"; public static final String MONTH = "mon"; public static final String DAY = "day"; public static final String HOUR = "hour"; public static final String MIN = "min"; public static HashMap<String, Object> getDate(Calendar calendar) { final HashMap<String, Object> date = new HashMap<String, Object>(); date.put(YEAR, calendar.get(Calendar.YEAR)); date.put(MONTH, calendar.get(Calendar.MONTH) + 1); date.put(DAY, calendar.get(Calendar.DAY_OF_MONTH)); date.put(HOUR, calendar.get(Calendar.HOUR_OF_DAY)); date.put(MIN, calendar.get(Calendar.MINUTE)); return date; }// w w w. j a v a 2s. c om }