Java Parse Time parseTime(String currDate, String format)

Here you can find the source of parseTime(String currDate, String format)

Description

parse Time

License

Apache License

Declaration

public static Date parseTime(String currDate, String format) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static Date parseTime(String currDate, String format) {
        SimpleDateFormat dtFormatdB = null;
        try {//from  w  w  w.  ja va  2s  .c  o m
            dtFormatdB = new SimpleDateFormat(format);
            return dtFormatdB.parse(currDate);
        } catch (Exception e) {
            dtFormatdB = new SimpleDateFormat("HH:mm:ss");
            try {
                return dtFormatdB.parse(currDate);
            } catch (Exception ex) {
            }
        }
        return null;
    }
}

Related

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