Here you can find the source of toDateHeader(LocalDateTime dt)
public static String toDateHeader(LocalDateTime dt)
//package com.java2s; //License from project: Apache License import java.time.LocalDateTime; import java.time.format.TextStyle; import java.util.Locale; public class Main { public static String toDateHeader(LocalDateTime dt) { return String.format("%s, %02d %s %d %s GMT", dt.getDayOfWeek().getDisplayName(TextStyle.SHORT, Locale.ENGLISH), dt.getDayOfMonth(), dt.getMonth().getDisplayName(TextStyle.SHORT, Locale.ENGLISH), dt.getYear(), dt.toLocalTime()); }//ww w.j av a 2 s .c o m }