Last active
April 7, 2020 23:44
-
-
Save manofi21/c367153273ebb9e14ea790541feddbb2 to your computer and use it in GitHub Desktop.
format - format pada datetime
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| YYYY-MM-DD => 2014-01-01 | |
| dddd, MMMM Do YYYY => Friday, May 16th 2014 | |
| hh:mm a => 12:30 pm | |
| 1. Weekday | |
| format | Example | |
| d | 0 s/d 6 | |
| dd | Su | |
| ddd | Sun | |
| dddd | Sunday | |
| 2. Year | |
| format | Example | |
| YY | 13 | |
| YYYY | 2013 | |
| 3. Month | |
| format | Example | |
| M | 1 s/d 12 (Jan is 1) | |
| Mo | 1st s/d 12th | |
| MM | 01 s/d 12 (Jan is 1) | |
| MMM | Jan | |
| MMMM | January | |
| 4.Quarter | |
| format | Example | |
| Q | 1 s/d 4 | |
| Qo | 1st s/d 4th | |
| 5. Day | |
| format | Example | |
| D | 1 s/d 31 | |
| Do | 1st s/d 31st | |
| DD | 01 s/d 31 | |
| DDD | 1 s/d 365 | |
| DDDo | 1st s/d 365th | |
| DDDD | 001 s/d 365 | |
| 6. Week of year | |
| format | Example | |
| W | 1 s/d 53 | |
| WO | 1st s/d 53rd | |
| WW | 01 s/d 53 | |
| 7. Hour | |
| format | Example | |
| H | 0 s/d 23 | |
| HH | 00 s/d 23 | |
| h | 1 s/d 12 | |
| hh | 01 s/d 12 | |
| m | 0 s/d 59 | |
| mm | 00 s/d 59 | |
| s | 0 s/d 59 | |
| ss | 00 s/d 59 | |
| a | am | |
| A | AM | |
| Z | +07:00 | |
| ZZ | +0730 | |
| 8. Desiseconds | |
| format | Example | |
| S | 0 s/d 9 | |
| 9. Centiseconds | |
| format | Example | |
| SS | 00 s/d 99 | |
| 10. Milliseconds | |
| format | Example | |
| SSS | 000 s/d 999 | |
| 11. Present | |
| LT 8:30 PM | |
| LTS 8:30:25 PM | |
| LL August 2 1985 | |
| ll Aug 2 1985 | |
| LLL August 2 1985 08:30 PM | |
| lll Aug 2 1985 08:30 PM | |
| LLLL Thursday, August 2 1985 08:30 PM | |
| llll Thu, Aug 2 1985 08:30 PM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment