Java String to Date TimeStringToDate(String s)

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

Description

Time String To Date

License

Open Source License

Declaration

public static Date TimeStringToDate(String s) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.ParsePosition;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static Date TimeStringToDate(String s) {
        Date date = new Date();
        try {//w  w  w  .jav  a  2 s.c  om
            SimpleDateFormat simpledateformat = new SimpleDateFormat("HH:mm:ss");
            ParsePosition parseposition = new ParsePosition(0);
            date = simpledateformat.parse(s, parseposition);
        } catch (Exception ex) {
        }
        return date;
    }
}

Related

  1. strToDate3(String i_StrDate)
  2. strToDateM6(String StrToDate)
  3. StrToDateSeco(String str)
  4. strToDatetime(String sStr)
  5. strToDateWithFormat(String strDate, Format format)
  6. timeToDate(String time)
  7. toDate(DateFormat format, String value)
  8. toDate(final Long date, final String pattern)
  9. toDate(final String _text, final String _dateFormat)