GWT DateTimeFormat所有PredefinedFormat演示

GWT DateTimeFormat所有PredefinedFormat演示:

(Examples of all GWT PredefinedFormats in DateTimeFormat)

源代码(Source Code,client only):

    StringBuilder sb = new StringBuilder();
    for (PredefinedFormat pff : PredefinedFormat.values())
    {
      DateTimeFormat fmt = DateTimeFormat.getFormat(pff);
      sb.append(pff.name()).append(“: “).append(fmt.format(new Date())).append(“<br />”);
    }

 

演示 (测试时间: 2012/12/03 14:51:01):

ISO_8601: 2012-12-03T14:51:01.321+01:00

RFC_2822: Mon, 3 Dec 2012 14:51:01 +0100
DATE_FULL: Monday, 2012 December 03
DATE_LONG: 2012 December 3
DATE_MEDIUM: 2012 Dec 3
DATE_SHORT: 2012-12-03
TIME_FULL: 14:51:01 UTC+1
TIME_LONG: 14:51:01 UTC+1
TIME_MEDIUM: 14:51:01
TIME_SHORT: 14:51
DATE_TIME_FULL: Monday, 2012 December 03 14:51:01 UTC+1
DATE_TIME_LONG: 2012 December 3 14:51:01 UTC+1
DATE_TIME_MEDIUM: 2012 Dec 3 14:51:01
DATE_TIME_SHORT: 2012-12-03 14:51
DAY: 3
HOUR_MINUTE: 2:51 PM
HOUR_MINUTE_SECOND: 2:51:01 PM
HOUR24_MINUTE: 14:51
HOUR24_MINUTE_SECOND: 14:51:01
MINUTE_SECOND: 51:01
MONTH: December
MONTH_ABBR: Dec
MONTH_ABBR_DAY: Dec 3
MONTH_DAY: December 3
MONTH_NUM_DAY: 12-3
MONTH_WEEKDAY_DAY: Monday December 3
YEAR: 2012
YEAR_MONTH: 2012 December
YEAR_MONTH_ABBR: 2012 Dec
YEAR_MONTH_ABBR_DAY: 2012 Dec 3
YEAR_MONTH_DAY: 2012 December 3
YEAR_MONTH_NUM: 2012-12
YEAR_MONTH_NUM_DAY: 2012-12-3
YEAR_MONTH_WEEKDAY_DAY: Mon, 2012 Dec 3
YEAR_QUARTER: 2012 4th quarter
YEAR_QUARTER_ABBR: 2012 Q4

Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s