Monday, 21 June 2010

Sorting by date

Hurrah!

My date sorting problem is finally solved. Simply format your date with the most important figures first, and with leading zeros. Then any ordinary sort (ie alphabetical) will return an array of these sorted by year, then month, etc.

eg. 4.15pm 23rd September 2009 => '2009-09-23-16-15'

PS. Actionscript 3 considers 09 to represent the month of October, because January is 0.

No comments:

Post a Comment

Please enter your message here...