2011年1月27日 星期四

Java date format pattern and Javascript Date object

* Letter(Presentation): Meaning, Examples

* G (Text): 西元, AD

* y (Year): year, yyyy (1996); yy (96)

* M (Month): Month in year, MMMM (July); MMM (Jul); MM (07)

* w (Number): Week in year, w (27)

* W (Number): Week in month, W (2)

* D (Number): Day in year, D (189)

* d (Number): day in month, d (10)

* F (Number): Day of week in month, F (2)

* E (Text): Day in week, EEE (Wed)

* a (Text): AM/PM marker, a (PM)

* H (Number): Hour in day (0-23), HH (13)

* k (Number): Hour in day (1-24), kk (24)

* K (Number): Hour in am/pm (0-11), K (0)

* h (Number): Hour in am/pm (1-12), h (12); hh (12)

* m (Number): Minute in hour, mm (00-59)

* s (Number): Second in minute, ss (55); s (55)

* S (Number): Millisecond,

* z (Gernal Time Zone): Time zone, Pacific Standard Time; PST; GMT-08:00

* Z (RFC 822 time zone): Time zone, -0800


==========================================================

Javascript


* getDate(): 1-31

* getDay(): 0-6

* getFullYear(): yyyy

* getMonth(): 0-11

* getHours(): 0-23

* getMinutes(): 0-59

* getSeconds(): 0-59



* Reference: Java API Document, Javascript Reference

沒有留言:

張貼留言