Java Date GMT Format parseDate(String gmtTimeString)

Here you can find the source of parseDate(String gmtTimeString)

Description

parse Date

License

Open Source License

Parameter

Parameter Description
gmtTimeString -

Return

-

Declaration

public static Date parseDate(String gmtTimeString) 

Method Source Code

//package com.java2s;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    /**//from   w w w .j  a  v  a  2 s  .co m
     * @param gmtTimeString
     *            -
     * @return -
     */
    public static Date parseDate(String gmtTimeString) {
        try {
            DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
            df.setTimeZone(java.util.TimeZone.getTimeZone("GMT"));
            Date date = df.parse(gmtTimeString);
            return date;
        } catch (ParseException e) {
            throw new RuntimeException("convrt to runtime exception", e);
        }
    }
}

Related

  1. getNewGmtSimpleDateFormat(String format)
  2. getStringBaseGMT(Date date, String timezone)
  3. getThreadLocalGMTDateFormat(final String format)
  4. getTimeAndDateAtGMT()
  5. getTzToGmt(String dateStr, String dateFormat, String beforeTimeZone, String afterTimeZone)
  6. parseGMT(String gmtTime)
  7. parseGMTDatetime(String str)
  8. parseGMTTime(Long time, String format)
  9. timeStampGMT(Date date)