Reputation: 1014
I am trying to parse a String using the SimpleDateFormat, but the resulting Date seems to be off by a few months (day of the week, time (different time zone) and year are correct).
def headers = messageExchange.getResponseHeaders()
def String dateHeader = headers.get("Date",null)
log.info "DATE:" + dateHeader
SimpleDateFormat dateFormat = new SimpleDateFormat("[EEE, dd MMM YYYY HH:mm:ss zzz]")
Date c = dateFormat.parse(dateHeader)
log.info c
OUTPUT:
DATE:[Thu, 08 Nov 2012 14:08:22 GMT]
INFO: Thu Jan 05 15:08:22 CET 2012
All ideas are welcome!
Upvotes: 0
Views: 1420