List of utility methods to do Date to Milliseconds Convert
long | getTimeInMillis(String date) get Time In Millis Date currentDate; try { String format = "HH:mm"; if (date.contains("-")) { format = "yyyy-MM-dd HH:mm:ss"; SimpleDateFormat dateForamt = new SimpleDateFormat(format); currentDate = dateForamt.parse(date); ... |
long | millisecondOf(int year, int month, int day) millisecond Of return millisecondOf(year, month, day, 0, 0);
|
long | millisecondOf(int year, int month, int day, int hour, int minute) millisecond Of try { 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 ... |