Class HttpDateHeader

java.lang.Object
io.micronaut.http.server.util.HttpDateHeader

@Internal public final class HttpDateHeader extends Object
Produces the value of the Date response header (RFC 1123, GMT). The text only changes once per second, so it is cached in a PerSecondCache shared by every response writer instead of being formatted for each response.
Since:
5.2.0
  • Method Details

    • now

      public static String now()
      The Date header value for the current wall-clock time.
      Returns:
      The RFC 1123 text
    • get

      public static String get(long epochMillis)
      The Date header value for the given instant.
      Parameters:
      epochMillis - The instant, in milliseconds since the epoch
      Returns:
      The RFC 1123 text