开发者

Flex 4.5 DateTimeFormatter: why is timeZone specific information ignored in dateTimePattern?

var df:DateTimeFormatter = new DateTimeFormatter();
df.dateTimePattern = "yyyy/MM/dd HH:mm:ss Z";
var formattedDate:String = df.format(new Date(2011, 6, 7));

formattedDate value is "2011/07/07 00:00:00 ". what am i doing wrong? cannot format nothing timeZone specific? i'm getting crazy about this... hel开发者_如何学Cp is appreciated a lot


See http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flash/globalization/DateTimeFormatter.html#setDateTimePattern%28%29 .

The documentation says that some operating systems don't support the timezone pattern... Apparently because the class implementing the formatting uses OS specific functions for timezone.

Workaround would be to implement your own formatter.


You shouldn't have to write your own formatter...

In Flex 4.5 they added some new localization features. You can't unfortunately always depend on the system to correctly identify the locale automatically.

Here adobe describes four different methods you can employ of identifying the locale of the user and setting it. Once this is set, the formatter will work correctly so you won't need to roll your own formatter.

http://help.adobe.com/en_US/flex/using/WS19f279b149e7481c-1c03f02c12bd00c4763-8000.html#WS19f279b149e7481c-99797f112bd080033f-8000

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜