Convert String timestamp with offset to Java date
2 answers
Threaded alternative from apache commons lang3. Firstly:
import org.apache.commons.lang3.time.FastDateFormat;
then
String strdate = "2014-04-03T14:02:57.182+0200";
String dateFormatPattern = "yyyy-mm-dd'T'HH:mm:ss.SSSZ";
Date date = FastDateFormat.getInstance(dateFormatPattern).parse(strdate);
System.out.println(date);
+2
source to share