Java Parse Date parseDateNewFormat(String sDate)

Here you can find the source of parseDateNewFormat(String sDate)

Description

parse Date New Format

License

Apache License

Declaration

public static Date parseDateNewFormat(String sDate) throws ParseException 

Method Source Code


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

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

import java.util.Date;

public class Main {
    public final static String newFormat = "yyyy-MM-dd HH:mm:ss";

    public static Date parseDateNewFormat(String sDate) throws ParseException {
        DateFormat dateFormat = new SimpleDateFormat(newFormat);
        Date d = dateFormat.parse(sDate);
        return d;
    }//w w  w .jav  a2s  . c  o  m
}

Related

  1. parseDateHMSMZ(String dateString)
  2. parseDateList(List dateList)
  3. parseDateLong(String date, Locale locale)
  4. parseDateLongFormat(String sDate)
  5. parseDateLoose(String dateString)
  6. parseDateNoTimeWithDelimit(String sDate, String delimit)
  7. parseDateOrTimeString(String aDateString, String aFormatString)
  8. parseDateRFC(String value)
  9. parseDateRfc822(String str)