Daniel Harfleet

Delivering user-centric applications on the Adobe Flash Platform using Flex and AIR

Posts Tagged ‘api

Translating Force.com Rest API Date to ActionScript Date

leave a comment »

Recently I have been calling the Force.com Rest API from ActionsScript in an AIR project. When translating my entity objects, I found the need to translate the date as it is represented in the Rest API, into an ActionScript date instance and vice versa.

The Rest API uses ISO 8601 Format.

Here is the code:

Convert from Rest API to ActionScript:


Convert from ActionScript to the Rest API:

The full code can be found here

and its unit test


Written by dharfleet

June 12, 2012 at 13:54