Java String to Date strChangeToDate(String str)

Here you can find the source of strChangeToDate(String str)

Description

str Change To Date

License

Apache License

Parameter

Parameter Description
str a parameter

Return

Date

Declaration

public static Date strChangeToDate(String str) 

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 strChangeToDate(String str) {

        Date date = null;//from w  w w .ja v  a2  s.c o m
        try {
            SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:SS");
            date = sd.parse(str);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return date;
    }
}

Related

  1. numberToDate(String dateString)
  2. putTimeStr14ToDate(String dateTimeStr)
  3. putTimeStr19ToDate(String dateTimeStr19)
  4. rfc3339ToDate(String s)
  5. SortStringToDate(String thisdate, Locale locale)
  6. strDateConvertToDate(String strDate, String fFormatStr)
  7. stringArrayTODateArray(String[] dates_s, SimpleDateFormat dateformat)
  8. stringDateToDate(String str)
  9. stringDateToDate(String StrDate)