Java Parse Time parseTime(String s)

Here you can find the source of parseTime(String s)

Description

Parses text in 'HH:mm:ss' format to produce a time.

License

Open Source License

Parameter

Parameter Description
s the text

Exception

Parameter Description
ParseException an exception

Return

Date

Declaration

static public Date parseTime(String s) throws ParseException 

Method Source Code

//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);
    }
}

Related

  1. parseTime(Calendar c, String time)
  2. parseTime(char[] timeChars)
  3. ParseTime(final String time)
  4. parseTime(String currDate, String format)
  5. parseTime(String date, String format)
  6. parseTime(String sTime)
  7. parseTime(String str)
  8. parseTime(String str)
  9. parseTime(String t)