Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

APEX_JSON.get_date - does it consider time zones?

AndyHJul 21 2017

The 'standard'/iso_8601 JSON format (as applied by APEX_JSON) for a date includes the 'Z' (zulu) to show that the date represents a UTC time.

Without the 'Z' the time should represent local time and, according to ISO8601, the Z could be replaced by standard time zone hour and minute offset information.

As far as I can see, APEX_JSON is not considering the time zone information when it returns a date: apex_json.get_date returns the same date whether or not a Z has been supplied in the JSON date string (and doesn't like time zone offset information).

So, when my REST client asks for something for 'now' it sends the UTC value for 'now'. I'm running in a Europe/London time zone and daylight savings is currently in effect: the REST client sends 12:00Z and apex_json.get_date returns this as 12:00 local time; this is an hour different to time requested and so I send the wrong information to the REST client.

I'm sure that I'm missing something here as many/most people using APEX_JSON must have local time zones that are far further from UTC than myself and would cause more issues?

Is my understanding of APEX_JSON.GET_DATE correct?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 18 2017
Added on Jul 21 2017
0 comments
455 views