Java Date from String getDateFromString(String stringDate)

Here you can find the source of getDateFromString(String stringDate)

Description

get Date From String

License

Open Source License

Declaration

public static Calendar getDateFromString(String stringDate) 

Method Source Code

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

import java.util.Calendar;

public class Main {
    public static Calendar getDateFromString(String stringDate) {
        //format expected YYYYMMDD
        Calendar calendar = Calendar.getInstance();
        calendar.set(new Integer(stringDate.substring(0, 4)), new Integer(stringDate.substring(4, 6)) - 1,
                new Integer(stringDate.substring(6, 8)), 0, 0, 0);
        return calendar;
    }/*from   w ww.  j  a  v a 2  s .  c  om*/
}

Related

  1. getDateFromPattern(String pattern)
  2. getDateFromReccurenceInterval(int reqDOW, int reqDOM, int time)
  3. getDateFromStartTime(String startTime)
  4. getDateFromString(String s)
  5. getDateFromString(String strDate, String strTime)
  6. getDateFromTime(long millisSinceMidnight)