UPDATE: I guess I didn’t think this one through completely. If you are using a component such as the DateChooser component or other class that returns a Date Object, using the Date2 Class will be of no use. So using the DateFormatter static class makes far more sense. Thanks Darron for the heads up on this one.

The other day I updated Darron Schalls dateFormat.as into a static class. Not sure why I just didn’t extend the Date class.

Anyhow.. I’ve made the quick change. You can download the Date2 Class here along with a sample FLA [LINK]

Sample code:
[as]
import Date2;

var now:Date2 = new Date2();

trace(now.formatTo(“mm-dd-yyyy”));
trace(now.formatTo(“mmmm d, yyyy”));
trace(now.formatTo(“mm/dd/yyyy”));
trace(now.formatTo(“d-mmm-yyyy”));
trace(now.formatTo(“ddd, mmmm dd, yyyy”));
trace(now.formatTo(“short”));
trace(now.formatTo(“medium”));
trace(now.formatTo(“long”));
trace(now.formatTo(“full”));[/as]