Java String to Date strToDateM6(String StrToDate)

Here you can find the source of strToDateM6(String StrToDate)

Description

StrToDate 'yyyy-MM-dd HH:mm:ss'

License

Apache License

Parameter

Parameter Description
StrToDate 'yyyy-MM-dd HH:mm:ss'

Return

Date

Declaration

public static Date strToDateM6(String StrToDate) 

Method Source Code

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

import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    /**//from w  w  w .  ja  v  a 2 s.c  o  m
     * StrToDate 'yyyy-MM-dd HH:mm:ss'
     * @param StrToDate 'yyyy-MM-dd HH:mm:ss'
     * @return Date
     */
    public static Date strToDateM6(String StrToDate) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
        try {
            return simpleDateFormat.parse(StrToDate);
        } catch (ParseException e) {
            //e.printStackTrace();
        }
        return null;
    }
}

Related

  1. strToDate(String strDate)
  2. strToDate(String strDate)
  3. strToDate(String strDate, String format)
  4. strToDate(String time, String format)
  5. strToDate3(String i_StrDate)
  6. StrToDateSeco(String str)
  7. strToDatetime(String sStr)
  8. strToDateWithFormat(String strDate, Format format)
  9. TimeStringToDate(String s)