Java String to Date toDate(String date)

Here you can find the source of toDate(String date)

Description

to Date

License

Apache License

Declaration

public static Date toDate(String date) 

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 {
    public static Date toDate(String date) {
        return toDate(date, "00:00.00.000");
    }//from   w w  w.  j  ava2  s  .c o  m

    public static Date toDate(String date, String time) {
        try {
            return new SimpleDateFormat("dd/MM/yyyy HH:mm").parse(date + " " + time);
        } catch (ParseException e) {
            throw new RuntimeException(e);
        }
    }
}

Related

  1. toDate(String date)
  2. toDate(String date)
  3. toDate(String date)
  4. toDate(String date)
  5. toDate(String date)
  6. toDate(String date, String dateFormat)
  7. toDate(String date, String format)
  8. toDate(String date, String format)
  9. toDate(String date, String format)