Java Calendar Calculate getGregorianCalendar(String yyyymmdd)

Here you can find the source of getGregorianCalendar(String yyyymmdd)

Description

get Gregorian Calendar

License

Apache License

Declaration

public static GregorianCalendar getGregorianCalendar(String yyyymmdd) 

Method Source Code

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

import java.util.*;

public class Main {

    public static GregorianCalendar getGregorianCalendar(String yyyymmdd) {
        int yyyy = Integer.parseInt(yyyymmdd.substring(0, 4));
        int mm = Integer.parseInt(yyyymmdd.substring(4, 6));
        int dd = Integer.parseInt(yyyymmdd.substring(6, 8));
        GregorianCalendar calendar = new GregorianCalendar(yyyy, mm - 1, dd, 0, 0, 0);
        return calendar;
    }//from   w  w w  .  ja  va2  s .  com
}

Related

  1. decode(String timestamp, Calendar calendar)
  2. encode(Calendar calendar, boolean encodeTzOffset, StringBuilder buf)
  3. equals(Calendar calendar1, Calendar calendar2)
  4. FormatTime(Calendar p_time, boolean p_showMilliseconds)
  5. getCalendar(long millis)
  6. getLongTime(Calendar cal)
  7. getTimeStr3(Calendar timeInstance)
  8. getTimeString(Calendar cal)
  9. getTimeStrWithMillisecond(Calendar timeInstance)