This is not a question, just a little observation that might save other folks a 
few minutes of gnashing of teeth and hair pulling.

I need some code that will give me the current date in ISO 8601 format, e.g. 
"2010-08-27".  I figured the Date class would be a good place to start, but I 
was really puzzled by the output I got.

This code...
  var date:Date = new Date;
  trace( date.fullYearUTC, date.monthUTC, date.dateUTC );
...prints out this:
   2010 7 27

The year and day of the month are correct, but the month is off by one. Huh??

Well, it turns out that monthUTC is the month with *zero* as January. It's 
documented, but pretty bizarre nonetheless... though it turns out the "tm" 
structure in C's time.h uses the same convention.

-Gerry



_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to