<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    JAVA & FLEX

    一個分享java和flex開發經驗的空間

       :: 首頁 ::  :: 聯系 ::  :: 管理 ::
      26 隨筆 :: 2 文章 :: 44 評論 :: 0 Trackbacks
    在Flex中,有的時候需要對日期做格式化,JAVA中我們已經很熟悉了,Flex中和JAVA大體相同,但是還有一個小小不一樣,看下面的例子

     1import mx.formatters.*;
     2private var myDataate=new Date(); 
     3private function changeDatas():void
     4{
     5// 格式化函數
     6var myDateFormatterateFormatter=new DateFormatter();
     7// 定義日期格式
     8myDateFormatter.formatString="YYYY-MM-DD JJ:NN:SS";
     9mx.controls.Alert.show(myDateFormatter.format(myData));
    10}

    Flex3語言參考手冊中,關于DateFormatter的formatString是這樣解釋的:

    The following table describes the valid pattern letters:

     

    Pattern letter

     

    Description

     

    Y

     

     

    Year. If the number of pattern letters is two, the year is truncated to two digits; otherwise, it appears as four digits. The year can be zero-padded, as the third example shows in the following set of examples:

     

    • YY = 05
    • YYYY = 2005
    • YYYYY = 02005

    M

     

     

    Month in year. The format depends on the following criteria:

     

    • If the number of pattern letters is one, the format is interpreted as numeric in one or two digits.
    • If the number of pattern letters is two, the format is interpreted as numeric in two digits.
    • If the number of pattern letters is three, the format is interpreted as short text.
    • If the number of pattern letters is four, the format is interpreted as full text.

    Examples:

     

    • M = 7
    • MM= 07
    • MMM=Jul
    • MMMM= July

    D

     

     

    Day in month. While a single-letter pattern string for day is valid, you typically use a two-letter pattern string.

     

    Examples:

     

    • D=4
    • DD=04
    • DD=10

    E

     

     

    Day in week. The format depends on the following criteria:

     

    • If the number of pattern letters is one, the format is interpreted as numeric in one or two digits.
    • If the number of pattern letters is two, the format is interpreted as numeric in two digits.
    • If the number of pattern letters is three, the format is interpreted as short text.
    • If the number of pattern letters is four, the format is interpreted as full text.

    Examples:

     

    • E = 1
    • EE = 01
    • EEE = Mon
    • EEEE = Monday

    A

     

     

    am/pm indicator.

     

    J

     

     

    Hour in day (0-23).

     

    H

     

     

    Hour in day (1-24).

     

    K

     

     

    Hour in am/pm (0-11).

     

    L

     

     

    Hour in am/pm (1-12).

     

    N

     

     

    Minute in hour.

     

    Examples:

     

    • N = 3
    • NN = 03

    S

     

     

    Second in minute.

     

    Example:

     

    • SS = 30

    Other text

     

     

    You can add other text into the pattern string to further format the string. You can use punctuation, numbers, and all lowercase letters. You should avoid uppercase letters because they may be interpreted as pattern letters.

     

    Example:

     

    • EEEE, MMM. D, YYYY at L:NN A = Tuesday, Sept. 8, 2005 at 1:26 PM
    posted on 2008-08-29 16:46 程序人生-天津 閱讀(3374) 評論(0)  編輯  收藏 所屬分類: Flex
    主站蜘蛛池模板: 在线免费视频你懂的| 成年免费大片黄在线观看com| a级毛片免费全部播放无码| 免费**毛片在线播放直播| 亚洲av午夜国产精品无码中文字| 成人影片麻豆国产影片免费观看| 亚洲一区免费视频| 成人免费视频77777| 亚洲色偷偷综合亚洲av78| 欧洲精品免费一区二区三区| 亚洲AV无码AV男人的天堂不卡| 无码视频免费一区二三区| 亚洲AV无码AV日韩AV网站| 亚洲日韩中文字幕日韩在线| 青青操在线免费观看| 亚洲视频一区在线观看| 噼里啪啦电影在线观看免费高清 | 亚洲一区二区三区免费在线观看 | 精品一区二区三区免费视频| 亚洲精品V欧洲精品V日韩精品 | 亚洲国产模特在线播放| 成年女性特黄午夜视频免费看| 日韩在线视精品在亚洲| 亚洲综合国产一区二区三区 | 成在人线AV无码免费| 美美女高清毛片视频黄的一免费| 国产亚洲精品高清在线| 91青青国产在线观看免费| 亚洲欧美aⅴ在线资源| 中文字幕中韩乱码亚洲大片| 91免费国产精品| 无码亚洲成a人在线观看| 亚洲精品一品区二品区三品区| 在线看片免费人成视久网| 亚洲精品无码不卡在线播放| 中文字幕第13亚洲另类| 免费黄色网址网站| 一区二区免费电影| 国产精品亚洲精品观看不卡| 中文字幕亚洲日韩无线码| 欧洲精品成人免费视频在线观看|