Код: Выделить всё
20130401100000[-03:EST]
Код: Выделить всё
yyyyMMddHHmmss'['Z':'z']'
Код: Выделить всё
public static void main(String[] args) throws ParseException {
String input = "20130401100000[-03:EST]";
DateFormat df = new SimpleDateFormat("yyyyMMddHHmmss'['Z':'z']'");
df.setTimeZone(TimeZone.getTimeZone("GMT"));
System.out.println(df.format(new Date()));
System.out.println(df.parse(input));
}
Код: Выделить всё
20130528155734[+0000:GMT]
Код: Выделить всё
Exception in thread "main" java.text.ParseException: Unparseable date: "20130401100000[-03:EST]"
at java.text.DateFormat.parse(DateFormat.java:337)
at Teste.main(Teste.java:17)
Подробнее здесь: https://stackoverflow.com/questions/167 ... rom-string
Мобильная версия