Created
June 10, 2015 11:05
-
-
Save tkowalcz/26207bfb1e46bf0da62c to your computer and use it in GitHub Desktop.
Java 1.8u60 will brake time zone formatting?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pl.codewise.voluum.api; | |
import org.joda.time.DateTimeZone; | |
import org.joda.time.format.DateTimeFormat; | |
import org.joda.time.format.DateTimeFormatter; | |
import org.joda.time.tz.FixedDateTimeZone; | |
import java.util.Date; | |
import java.util.Locale; | |
public class DateFormattingBug { | |
private static final DateTimeZone GMT = new FixedDateTimeZone("GMT", "GMT", 0, 0); | |
public static void main(String[] args) { | |
DateTimeFormatter formatter = DateTimeFormat.forPattern("EEE, dd MMM yyyy HH:mm:ss z") | |
.withLocale(Locale.US) | |
.withZone(GMT); | |
String date = formatter.print(new Date().getTime()); | |
System.out.println("date = " + date); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment