Here you can find the source of parseTime(String s)
Parameter | Description |
---|---|
s | the text |
Parameter | Description |
---|---|
ParseException | an exception |
static public Date parseTime(String s) throws ParseException
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**// w w w .java 2s.c o m * format pattern : HH:mm:ss */ public static final SimpleDateFormat FORMAT_HMS = new SimpleDateFormat("HH:mm:ss"); /** * Parses text in 'HH:mm:ss' format to produce a time. * * @param s * the text * @return Date * @throws ParseException */ static public Date parseTime(String s) throws ParseException { return FORMAT_HMS.parse(s); } }