Java Parse Date Pattern YYYY parseToGregorianCalendar(String dateString)

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

Description

parse To Gregorian Calendar

License

Open Source License

Declaration

public static GregorianCalendar parseToGregorianCalendar(String dateString) throws ParseException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

import java.util.GregorianCalendar;

import java.util.TimeZone;

public class Main {
    public static final String DATE_FORMAT_STRING = "yyyy-MM-dd'T'HH:mm:ss";
    public static final String GMT_TIMEZONE = "GMT";

    public static GregorianCalendar parseToGregorianCalendar(String dateString) throws ParseException {
        DateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_STRING);
        GregorianCalendar calendar = new GregorianCalendar(TimeZone.getTimeZone(GMT_TIMEZONE));
        calendar.setTime(dateFormat.parse(dateString));
        return calendar;
    }/*from   w w  w  .  j  a v a 2s  .c om*/
}

Related

  1. parseTIPPDate(String dateString)
  2. parseToDate(final String date, final String format)
  3. parseToDate(String date)
  4. parseToDate(String date, String format)
  5. parseToDateLenient(final String date, final String format, final boolean lenient)
  6. parseToRegExcel(String raw)
  7. parseToString(Date date)
  8. parseToString(Date date, String format)
  9. parseToString(final Date date, final String format)