Java Date Format As formatDateHeader(final Date date)

Here you can find the source of formatDateHeader(final Date date)

Description

format Date Header

License

Open Source License

Declaration

public static String formatDateHeader(final Date date) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2014 Red Hat, Inc../*from  ww w .j  av  a  2  s. c om*/
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v3.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/gpl.html
 * 
 * Contributors:
 *     Red Hat, Inc. - initial API and implementation
 ******************************************************************************/

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

public class Main {
    private static final String DATE_HEADER_FMT = "EEE, dd MMM yyyy HH:mm:ss zzz";

    public static String formatDateHeader(final long date) {
        return new SimpleDateFormat(DATE_HEADER_FMT).format(new Date(date));
    }

    public static String formatDateHeader(final Date date) {
        return new SimpleDateFormat(DATE_HEADER_FMT).format(date);
    }
}

Related

  1. formatDateForGMT(Date moonDate)
  2. formatDateForLogFileName(Date date)
  3. formatDateForTAP(Date date)
  4. formatDateForXpath(Date date)
  5. formatDateGMT(Date date)
  6. formatDateHeader(final Date date)
  7. formatDateHMS(java.util.Date date)
  8. formatDateHMSMZ(Date date)
  9. formatDateList(List dateList)