Java yyyy formatSpaydDate(Date date, TimeZone tz)

Here you can find the source of formatSpaydDate(Date date, TimeZone tz)

Description

format Spayd Date

License

Apache License

Declaration

public static String formatSpaydDate(Date 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 String formatSpaydDate(Date date, TimeZone tz) throws ParseException {
        if (date == null) {
            return null;
        }//from  ww  w.j a  v  a2 s .c o m

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

Related

  1. formatPGNDate(final Date pDate)
  2. formatRTGSDate(java.util.Date date)
  3. formatShortDate(Date date)
  4. formatSimpleDate(Date date)
  5. formatSimpleGermanDateString(Date date)
  6. formatStr(Date date)
  7. formatString(Date date)
  8. formattedDate(final String format, final Date tweetPollDate)
  9. formatter()