Skip to content

Flex DateTime Formatter for ACS

November 25, 2012

This Date Format String is to be passed to Appcelerator Cloud Services for handling all Dates on the Cloud.

<s:DateTimeFormatter id="dateACSFormatter" dateTimePattern="yyyy-MM-dd HH:mm:ss Z" useUTC="true />
var stringed = String(dateACSFormatter.format(eventDate.selectedDate)).replace(' ', 'T').replace(' ', ''))

To Get Back from the Server an ACS Formatted Date String into an Actionscript Date Object:

DateUtil.parseW3CDTF(stringed))

In Titanium... momentjs comes also very handy:
moment(message.updated_at, "YYYY-MM-DDTHH:mm:ssZ").fromNow()
Advertisements

From → AIR, Appcelerator

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: