Java Parse Date parseDateTimeHuman(String dateString)

Here you can find the source of parseDateTimeHuman(String dateString)

Description

parse Date Time Human

License

Apache License

Declaration

public static Date parseDateTimeHuman(String dateString) 

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 static final String DATE_TIME_PATTERN_HUMAN = "dd/MM/yyyy HH:mm";

    public static Date parseDateTimeHuman(String dateString) {
        DateFormat df = new SimpleDateFormat(DATE_TIME_PATTERN_HUMAN);
        Date date;/* w  w w. j a v  a  2 s  .  c  o m*/
        try {
            date = df.parse(dateString);
        } catch (ParseException e) {
            date = new Date();
        }
        return date;
    }
}

Related

  1. parseDateTime(String s)
  2. parseDateTime(String s)
  3. parseDateTime(String s)
  4. parseDatetime(String value)
  5. parseDateTimeFromString(String datetime)
  6. parseDateTimeString(final String date)
  7. parseDateTimeString(String dateTime)
  8. parseDateTimeString(String dateTimeString)
  9. parseDateToStr(Date date)