I think you should be using JJ instead of
HH in yoru format string since normally we go 0-23 for hours and not 1-24. The
ASDoc for the DateFormatter describes the characters in more details. I admit
it does seem like HH should be the 0-23 version since it’s more common…
Matt
Sample code used to recreate
problem (used within an actionScript class):
private static var dateFormatter:DateFormatter =
new DateFormatter();
dateFormatter.formatString = "EEEE MMMM DD,
YYYY - HH:NN";
var tmp:Date = new Date( someDateInMilli );
logger.debug( "" + tmp,
dateFormatter.format( tmp ) );
I am attempting to use the DateFormatter in Flex
to format a time in
milliseconds that comes from a mapped Java
class. I first convert the
time to a Date in ActionScript, and then use the
DateFormatter to
format the date string. Now for the strange
part: when I log the
newly created Date and the formatted date string
as specified in the
code above, I get the following results:
tmp = Tue Dec 6 14:40:00 GMT-0500 2005
format(tmp) = Tuesday December, 6 2005 - 15:40
The formatted version of the date is the correct
format, however it
seems to add an extra hour after the format
(possibly due to timezone
settings?)
Help if you can.
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
YAHOO! GROUPS LINKS
|