Java Parse Date Pattern YYYY parseFullTime(String str)

Here you can find the source of parseFullTime(String str)

Description

parse Full Time

License

Apache License

Declaration

public static Date parseFullTime(String str) throws ParseException 

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.TimeZone;

public class Main {
    public static Date parseFullTime(String str) throws ParseException {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");

        return format.parse(str);
    }//from   w  w  w.j  av  a2 s .c o  m

    public static Date parseFullTime(String str, TimeZone timeZone) throws ParseException {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
        format.setTimeZone(timeZone);

        return format.parse(str);
    }

    public static Date parse(String pattern, String dateStr) throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat(pattern);
        sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
        return sdf.parse(dateStr);
    }
}

Related

  1. parseEXIFFormat(String dateString)
  2. parseExpireField(String timestring)
  3. parseFormattedTime(String formattedTime)
  4. parseFTPDate(String dateStr)
  5. parseFullDate(String paramName, String dateStr)
  6. parseGeneralizedTimeAsDate(String generalizedTime)
  7. parseHeaderDate(String headerValue)
  8. parseHHMMSS(long time)
  9. parseInsituFileNameDateFormat(String timeString)