November 10th, 2005
DateFormatter static class (update of Darron Schalls dateFormat.as)
I was at a ColdFusion 101 demo the other day at our Las Vegas User Group meeting and was watching Dave Byer use the CF Date formatting using masks. I had always thought that was something Flash needed built-in and I figured someone must have already built this. I started to look around and found a couple of things. The first was Darron Schall's dateFormat.as which was his port of ColdFusions's date formatting. I also found that ActionScript 3.0 will have the ability to format as well (via Macromedia Labs).
Darron's ActionScript was more promising because I can use it now, but its a bit dated with the #include , so I decided to take a few moments and update it to a static Class.
Anyhow.. Here is my modification on Darron's original script. The zip contains the class and a sample FLA. Kudo's to Darron for doing all the hard work!!
Download: DateFormatter Class
Actionscript:
-
import DateFormatter;
-
var testDate:Date = new Date();
-
trace(DateFormatter.formatTo(testDate, "mm/dd/yyyy"));

2 Responses to “DateFormatter static class (update of Darron Schalls dateFormat.as)”
[…] urchinTracker();
Flash | Retrospective
« DateFormatter static class (update of Da […]
By Flash | Retrospective » Blog Archive » Learn something new every day November 15th, 2005 at 12:44 pm
[…] November 15th, 2005 Update to Date Formatter The other day I updated Darron Schalls dateFormat.as int […]
By Flash | Retrospective » Blog Archive » Update to Date Formatter November 15th, 2005 at 2:17 pm