Java Date Long Format getLongDateString(Date date)

Here you can find the source of getLongDateString(Date date)

Description

get Long Date String

License

Apache License

Declaration

public static String getLongDateString(Date date) 

Method Source Code


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

import java.text.DateFormat;

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

public class Main {
    public static String longFormat = "yyyyMMddHHmmss";

    public static String getLongDateString(Date date) {
        return getLongDateString(date, TimeZone.getDefault());
    }//from ww w  . ja  v  a2s  . c o m

    public static String getLongDateString(Date date, TimeZone zone) {
        if (date == null)
            return null;
        DateFormat dateFormat = new SimpleDateFormat(longFormat);
        dateFormat.setTimeZone(zone);
        return dateFormat.format(date);
    }
}

Related

  1. getLongDateFormat(Date d)
  2. getLongDateFormatter()
  3. getLongDateStr(Date sDate)
  4. getLongDateString(Date date)
  5. getLongDateString(Date date)
  6. getLongDateString(Date date, boolean includeTime)
  7. getLongDisplayDate(Date moment, TimeZone tz, Locale inLocale)
  8. getLongDisplayTime(long time)
  9. getLongFormatTime(java.util.Date date)