In the netty framework there is the following code:
final class CookieDateFormat extends SimpleDateFormat {
private static final long serialVersionUID = 1789486337887402640L;
CookieDateFormat() {
super("E, d-MMM-y HH:mm:ss z", Locale.ENGLISH);
setTimeZone(TimeZone.getTimeZone("GMT"));
}
}
The issue I am having is that the above's output varies depending on the version of the jvm when I run it.
Is there any way to change the behavior on java 1.6 to match the output of 1.7 without having to alter the code (since I would prefer not having to change code in netty).
Try to use d-MMM-yyyy
instead of d-MMM-y
. I hope that difference in seconds (41 vs 14) is your typing mistake. Otherwise I cannot explain this difference.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.