Here you can find the source of timeToInt(final String time)
Parameter | Description |
---|---|
time | the time to parse |
public static int timeToInt(final String time)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w .j a v a2 s. com*/ * Parses time values such as 09:16:45 from gtfs to an integer values * represented in seconds. For example: 9*3600 + 16*60 + 45 * * @param time the time to parse * @return number of seconds for given time */ public static int timeToInt(final String time) { String[] times = time.split(":"); int hours = Integer.parseInt((String) times[0]); int minutes = Integer.parseInt((String) times[1]); int seconds = Integer.parseInt((String) times[2]); return (seconds + minutes * 60 + hours * 3600); } }