Java Hour Format forMateDate(String dateStr)

Here you can find the source of forMateDate(String dateStr)

Description

for Mate Date

License

Apache License

Declaration

public static Date forMateDate(String dateStr) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

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

import java.util.Date;
import java.util.Locale;

public class Main {

    public static Date forMateDate(String dateStr) {
        Date date = null;/*  www  .j av a 2 s .c  om*/
        try {
            String pattern = "EEE, dd MMM yyyy HH:mm:ss z";
            SimpleDateFormat format = new SimpleDateFormat(pattern, Locale.US);
            date = format.parse(dateStr);
            return date;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return date;
    }

    public static Date parse(String strDate, String format) throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.parse(strDate);
    }
}

Related

  1. formatDuration(long duration)
  2. formatDuration(long value)
  3. formateDataC(Date date)
  4. formateDate(Date date)
  5. formateDate(Date date, String format)
  6. formateDaTime(Date date)
  7. formateEndTimeString(String time)
  8. formatEndTime(String datePre)
  9. formatFF(String date)