Java HTTP Date getHttpDate(long l)

Here you can find the source of getHttpDate(long l)

Description

get Http Date

License

Open Source License

Declaration

public static String getHttpDate(long l) 

Method Source Code

//package com.java2s;
/* //from  ww  w  .j  a  v  a2  s.c  o m
 *  Copyright (C) 2012 AW2.0 Ltd
 *
 *  org.aw20 is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  Free Software Foundation,version 3.
 *  
 *  OpenBD is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *  
 *  You should have received a copy of the GNU General Public License
 *  along with org.aw20.  If not, see http://www.gnu.org/licenses/
 *  
 *  Additional permission under GNU GPL version 3 section 7
 *  
 *  If you modify this Program, or any covered work, by linking or combining 
 *  it with any of the JARS listed in the README.txt (or a modified version of 
 *  (that library), containing parts covered by the terms of that JAR, the 
 *  licensors of this Program grant you additional permission to convey the 
 *  resulting work. 
 *  
 *  $Id: FileUtil.java 2981 2012-08-08 21:01:27Z alan $
 */

import java.text.SimpleDateFormat;

public class Main {
    public static String getHttpDate(long l) {
        return getDateString(l, "EEE, d MMM yyyy HH:mm:ss") + " GMT";
    }

    public static String getHttpDate(java.util.Date _date) {
        return getDateString(_date, "EEE, d MMM yyyy HH:mm:ss") + " GMT";
    }

    public static String getDateString(java.util.Date _date, String _pattern) {
        return new SimpleDateFormat(_pattern).format(_date);
    }

    public static String getDateString(long _epoch, String _pattern) {
        return new SimpleDateFormat(_pattern).format(_epoch);
    }
}

Related

  1. getHttpDate()
  2. gethttpDate()
  3. getHTTPDate()
  4. getHttpDate()
  5. getHttpDate(int days)
  6. getHttpDate(String date)
  7. getHttpDate(String value)
  8. getHttpDateFormat()
  9. getHttpDateFormat(String dataFormat, Locale defaultLocale, String defaultTimeZone)