Guest User

Untitled

a guest
Nov 20th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. # PHP Date Cheatsheet
  2. | Day Format | Value/Example |
  3. | ------------- | ------------- |
  4. | d | 01 through 31 |
  5. | D | Mon through Sun |
  6. | j | 1 through 31 |
  7. | l (lowercase 'L') | Sunday throguh Saturday |
  8. | N | 1 (Monday) to 7 (Sunday) |
  9. | S | st, nd, rd, th |
  10. | w | 0 (sunday) through 6 (Saturday) |
  11. | z | 0 through 365 |
  12.  
  13. | Week Format | Value/Example |
  14. | ------------- | ------------- |
  15. | W | 42 (42nd week in year) |
  16.  
  17. | Month Format | Value/Example |
  18. | ------------- | ------------- |
  19. | F | January through December |
  20. | m | 01 through 12 |
  21. | M | Jan through Dec |
  22. | n | 1 through 12 |
  23. | t | 28 through 31 |
  24.  
  25. | Year Format | Value/Example |
  26. | ------------- | ------------- |
  27. | L | 1 (leap year), 0 otherwise |
  28. | o | same as Y, except that it use week number to decide which year it falls onto |
  29. | Y | 1991, 2012, 2014, ... |
  30. | y | 91, 12, 14, ... |
  31.  
  32. | Time Format | Value/Example |
  33. | ------------- | ------------- |
  34. | a | am or pm |
  35. | A | AM or PM |
  36. | B | 000 through 999 |
  37. | g | 1 through 12 |
  38. | G | 0 through 23 |
  39. | h | 01 through 12 |
  40. | H | 01 through 23 |
  41. | i | 00 throguh 59 |
  42. | u | 123456 (microseconds) |
  43.  
  44. | Timezone Format | Value/Example |
  45. | ------------- | ------------- |
  46. | e | UTC, GMT, Atlantic/Azores |
  47. | I (capital i) | 1 (daylight), 0 otherwise |
  48. | O | +0200 |
  49. | P | +02:00 |
  50. | T | EST, MDT, ... |
  51. | Z | -43200 through 50400 (timezone offset) |
  52.  
  53. | Date/Time Format | Value/Example |
  54. | ------------- | ------------- |
  55. | c | 2004-02-12T15:19:21+00:00 |
  56. | r | Thu, 21 Dec 2000 16:01:07 +0200 |
  57. | U | seconds since Jan 1 1970 00:00:00 GMT |
Add Comment
Please, Sign In to add comment