Here you can find the source of convertIso8601FormatToArsTimeOfDay(String timeOfDayString)
public static String convertIso8601FormatToArsTimeOfDay(String timeOfDayString) throws ParseException
//package com.java2s; //License from project: BSD License import java.text.ParseException; public class Main { /** Converts a string in ISO8601 Format into the string corresponding to an Ars internal time of day representation */ public static String convertIso8601FormatToArsTimeOfDay(String timeOfDayString) throws ParseException { int hours, minutes, seconds; int total = 0; try {// w w w. j av a2 s.c om hours = Integer.parseInt(timeOfDayString.substring(0, 2)); } catch (NumberFormatException e) { throw new ParseException("Unparseable dime: " + timeOfDayString, 0); } try { minutes = Integer.parseInt(timeOfDayString.substring(3, 5)); } catch (NumberFormatException e) { throw new ParseException("Unparseable dime: " + timeOfDayString, 3); } try { seconds = Integer.parseInt(timeOfDayString.substring(6)); } catch (NumberFormatException e) { throw new ParseException("Unparseable dime: " + timeOfDayString, 6); } total = hours * 3600 + minutes * 60 + seconds; return String.valueOf(total); } }