The list of methods to do Second Parse are organized into topic(s).
double
parseHHMMSSToSeconds(String txt) parse HHMMSS To Seconds
if (txt.length() == 0)
return 0;
String[] tim = txt.split(":");
if (tim.length == 1)
return Double.parseDouble(tim[1]);
else if (tim.length == 2)
return Integer.parseInt(tim[0], 10) * 60 + Double.parseDouble(tim[1]);
else if (tim.length == 3)
...
int
parseSeconds(String value, int defaultValue) Returns value as a positive integer, or 0 if it is negative, or defaultValue if it cannot be parsed.
try {
long seconds = Long.parseLong(value);
if (seconds > Integer.MAX_VALUE) {
return Integer.MAX_VALUE;
} else if (seconds < 0) {
return 0;
} else {
return (int) seconds;
...
int
parseTimeStringAsSeconds(String timeString) parse Time String As Seconds
int seconds;
String[] timeComponents = timeString.split(":");
if (timeComponents.length == 0) {
seconds = 0;
} else if (timeComponents.length == 1) {
seconds = Integer.parseInt(timeComponents[0]) * 60;
} else if (timeComponents.length == 2) {
int minutes = 0;
...