Java String to Time string2Date(String time)

Here you can find the source of string2Date(String time)

Description

string Date

License

Open Source License

Declaration

public static Date string2Date(String time) 

Method Source Code

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

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

import java.util.Date;

public class Main {

    public static Date string2Date(String time) {
        DateFormat dateFormat = new SimpleDateFormat("yyyyMMddhhssmm");
        Date date = new Date();
        try {/*  ww  w.  j av  a 2  s .co m*/
            date = dateFormat.parse(time);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return date;
    }
}

Related

  1. getTime(String time)
  2. getTimeDate(String time)
  3. getTimes(String startTime, String endTime)
  4. replaceDateTime(String input)
  5. str2DateTime(String strDate)
  6. string2DateTime(String stringDate)
  7. string2DateTimeByAutoZero(String stringDate)
  8. stringToCalendar(String stringTime)
  9. stringToCalendar(String timeStr)