Java Parse Date parseDateTime(String dateTimeString)

Here you can find the source of parseDateTime(String dateTimeString)

Description

parse Date Time

License

Open Source License

Declaration

public static final java.util.Date parseDateTime(String dateTimeString) throws java.text.ParseException 

Method Source Code

//package com.java2s;

import java.text.DateFormat;

import java.text.SimpleDateFormat;

public class Main {
    public static final java.util.Date parseDateTime(String dateTimeString) throws java.text.ParseException {
        DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT);
        if (df instanceof SimpleDateFormat) {
            SimpleDateFormat sdf = (SimpleDateFormat) df;
            sdf.applyPattern(sdf.toPattern() + " HH:mm:ss");
            df = sdf;//from w w w  . j  a v a  2s.co m
        }

        return df.parse(dateTimeString);
    }
}

Related

  1. parseDateTime(String date)
  2. parseDateTime(String date, String format, String locale, String timeZone)
  3. parseDateTime(String date, String time)
  4. parseDateTime(String dateTime)
  5. parseDateTime(String dateTimeStr)
  6. parseDateTime(String dateTimeString)
  7. parseDateTime(String dateTimeString, String[] validFormats, String outputFormat)
  8. parseDateTime(String format, String dateStr)
  9. parseDateTime(String fullDateParam, String unixDateParam, Map request)