Here you can find the source of millisecondOf(int year, int month, int day)
public static long millisecondOf(int year, int month, int day)
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { public static long millisecondOf(int year, int month, int day, int hour, int minute) { try {//from w ww. j a v a 2 s. com SimpleDateFormat format = new SimpleDateFormat( "yyyy-MM-dd mm:ss", Locale.getDefault()); Date date = format.parse("" + year + "-" + (month + 1) + "-" + day + " " + hour + ":" + minute); return date.getTime(); } catch (ParseException e) { android.util.Log.e("DateTimeUtil#millisecondOf", e .getStackTrace().toString()); throw new RuntimeException(e); } } public static long millisecondOf(int year, int month, int day) { return millisecondOf(year, month, day, 0, 0); } }