Saturday, August 25, 2007

Flex and Rails Dates

I'm not sure how I didn't run into this before, but I had some trouble parsing and dealing with dates coming from Rails' to_xml rendering of an object in Flex.

The dates were coming back looking like this: 2007-08-29T23:18:07-06:00, which I'd never seen before. I've found out since that it's in the W3C date time format.

Luckly for me, I found that the as3corelib has just what I needed: a DateUtil.parseW3CDT and DateUtil.toW3CDTF method.

If you're passing dates back and forth between Flex and Rails, at least with xml, you may want to check the corelib out, but make sure you look at it anyway.

1 comment:

gflamino said...

OMG - this was driving me crazy! Thanks for the post.