Here you can find the source of getExpires(long maxAge)
public static String getExpires(long maxAge)
//package com.java2s; /*/* ww w . ja va2 s. co m*/ * Protorabbit * * Copyright (c) 2009 Greg Murray (protorabbit.org) * * Licensed under the MIT License: * * http://www.opensource.org/licenses/mit-license.php * */ import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { private static SimpleDateFormat sdf = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss z"); public static String getExpires(long maxAge) { long created = System.currentTimeMillis(); Date expiredate = new Date(created + (maxAge * 1000)); sdf.setTimeZone(TimeZone.getTimeZone("GMT")); return sdf.format(expiredate); } }