Android Utililty Methods Time to Milliseconds Convert

List of utility methods to do Time to Milliseconds Convert

Description

The list of methods to do Time to Milliseconds Convert are organized into topic(s).

Method

inttime2IntMillis(String timestr)
time Int Millis
String[] times = timestr.split(":");
if (times.length == 1) {
    return Integer.parseInt(times[0]) * 1000;
} else if (times.length == 2) {
    return (Integer.parseInt(times[0]) * 60 + Integer
            .parseInt(times[1])) * 1000;
} else if (times.length == 3) {
    return 0;
...
longtime2LongMillis(String timestr)
time Long Millis
String[] times = timestr.split(":");
if (times.length == 1) {
    return Long.parseLong(times[0]) * 1000;
} else if (times.length == 2) {
    return (Long.parseLong(times[0]) * 60 + Long
            .parseLong(times[1])) * 1000;
} else if (times.length == 3) {
    return (Long.parseLong(times[0]) * 3600
...
longtimeStr2Secs(String s)
Converts a String in the format 00:00 to a long, being the number of seconds
long seconds = 0;
String parts[] = s.split(":", 2);
switch (parts.length) {
case 2:
    long minutes = Long.parseLong(parts[0]);
    seconds += minutes * 60;
    seconds += Long.parseLong(parts[1]);
    break;
...
longgetTimeinMillis(int year, int month, int day)
get Timein Millis
Calendar cal = Calendar.getInstance();
cal.set(year, month - 1, day);
return cal.getTimeInMillis();