Java Long Number to Date formatDateHeader(final long date)

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

Description

format Date Header

License

Open Source License

Declaration

public static String formatDateHeader(final long date) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2014 Red Hat, Inc../* w  w w  . j  a  va  2 s  . c o  m*/
 * 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. formatDate(String format, long timestamp)
  2. formatDate2DateStr(long date)
  3. formatDate2DateStr(long date)
  4. formatDateForLog(long dateTs)
  5. formatDateHeader(final long date)
  6. formatDateHeader(long millis)
  7. formatDateHeader(long value)
  8. formatDateISO(long millis)
  9. formatDateTime(long d)