0

I'm using hotelbeds API (developer.hotelbeds.com) and I'm getting a date string in a JSON response as follows.

"cancellationPolicies": [
   {
     "amount": "407.56",
     "from": "2016-09-19T23:59:00-04:00"
   }
]

Does anyone know what is that "-04:00" means? I already checked the API docs and cannot find anything. I want to parse this date string in to a Date Object in Java, something like this,

Date fromDate = new SimpleDateFormat("pattern").parse("dateTimeString");

Does anyone have an idea?

Chathura Buddhika
  • 2,067
  • 1
  • 21
  • 35
  • The `-04:00` is the timezone and you can't discard it unless you assume it is always this value. – Peter Lawrey Aug 05 '16 at 10:14
  • Take a look at the documentation, [right here](http://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html#iso8601timezone). – Tunaki Aug 05 '16 at 10:15
  • Refer the API : https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html – Unknown Aug 05 '16 at 10:15

1 Answers1

0

Does anyone know what is that "-04:00" means?

It is simply the timezone offset, here it means GMT minus 4 hours.

Nicolas Filotto
  • 43,537
  • 11
  • 94
  • 122