Java Parse Date Pattern YYYY parseSpaydDate(String date, TimeZone tz)

Here you can find the source of parseSpaydDate(String date, TimeZone tz)

Description

parse Spayd Date

License

Apache License

Declaration

public static Date parseSpaydDate(String date, TimeZone tz) throws ParseException 

Method Source Code


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

import java.text.DateFormat;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

public class Main {
    private static DateFormat dateFormat = null;

    public static Date parseSpaydDate(String date, TimeZone tz) throws ParseException {
        if (date == null) {
            return null;
        }/*  ww w  .ja v a 2s .c om*/

        if (dateFormat == null) {
            dateFormat = new SimpleDateFormat("yyyyMMdd");
        }
        if (tz != null) {
            dateFormat.setTimeZone(tz);
        } else {
            dateFormat.setTimeZone(TimeZone.getDefault());
        }
        return dateFormat.parse(date);
    }
}

Related

  1. parseSessionTime(String response)
  2. parseSilently(String p_string)
  3. parseSimpleDate(String string, Date defaultDate)
  4. parseSipDateTime(String dateStr)
  5. parseSolrDate(String date)
  6. parseString(String date)
  7. parseString(String dateStr)
  8. parseString(String strDate)
  9. parseString2Calendar(String date)