pkg.go 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. Package strftime provides strftime/strptime compatible time formatting and parsing.
  3. The following specifiers are available:
  4. Date (Year, Month, Day):
  5. %Y - Year with century (can be negative, 4 digits at least)
  6. -0001, 0000, 1995, 2009, 14292, etc.
  7. %C - year / 100 (round down, 20 in 2009)
  8. %y - year % 100 (00..99)
  9. %m - Month of the year, zero-padded (01..12)
  10. %-m no-padded (1..12)
  11. %B - Full month name (January)
  12. %b - Abbreviated month name (Jan)
  13. %h - Equivalent to %b
  14. %d - Day of the month, zero-padded (01..31)
  15. %-d no-padded (1..31)
  16. %e - Day of the month, blank-padded ( 1..31)
  17. %j - Day of the year (001..366)
  18. %-j no-padded (1..366)
  19. Time (Hour, Minute, Second, Subsecond):
  20. %H - Hour of the day, 24-hour clock, zero-padded (00..23)
  21. %-H no-padded (0..23)
  22. %k - Hour of the day, 24-hour clock, blank-padded ( 0..23)
  23. %I - Hour of the day, 12-hour clock, zero-padded (01..12)
  24. %-I no-padded (1..12)
  25. %l - Hour of the day, 12-hour clock, blank-padded ( 1..12)
  26. %P - Meridian indicator, lowercase (am or pm)
  27. %p - Meridian indicator, uppercase (AM or PM)
  28. %M - Minute of the hour (00..59)
  29. %-M no-padded (0..59)
  30. %S - Second of the minute (00..60)
  31. %-S no-padded (0..60)
  32. %L - Millisecond of the second (000..999)
  33. %f - Microsecond of the second (000000..999999)
  34. %N - Nanosecond of the second (000000000..999999999)
  35. Time zone:
  36. %z - Time zone as hour and minute offset from UTC (e.g. +0900)
  37. %:z - hour and minute offset from UTC with a colon (e.g. +09:00)
  38. %Z - Time zone abbreviation (e.g. MST)
  39. Weekday:
  40. %A - Full weekday name (Sunday)
  41. %a - Abbreviated weekday name (Sun)
  42. %u - Day of the week (Monday is 1, 1..7)
  43. %w - Day of the week (Sunday is 0, 0..6)
  44. ISO 8601 week-based year and week number:
  45. Week 1 of YYYY starts with a Monday and includes YYYY-01-04.
  46. The days in the year before the first week are in the last week of
  47. the previous year.
  48. %G - Week-based year
  49. %g - Last 2 digits of the week-based year (00..99)
  50. %V - Week number of the week-based year (01..53)
  51. %-V no-padded (1..53)
  52. Week number:
  53. Week 1 of YYYY starts with a Sunday or Monday (according to %U or %W).
  54. The days in the year before the first week are in week 0.
  55. %U - Week number of the year. The week starts with Sunday. (00..53)
  56. %-U no-padded (0..53)
  57. %W - Week number of the year. The week starts with Monday. (00..53)
  58. %-W no-padded (0..53)
  59. Seconds since the Unix Epoch:
  60. %s - Number of seconds since 1970-01-01 00:00:00 UTC.
  61. %Q - Number of milliseconds since 1970-01-01 00:00:00 UTC.
  62. Literal string:
  63. %n - Newline character (\n)
  64. %t - Tab character (\t)
  65. %% - Literal % character
  66. Combination:
  67. %c - date and time (%a %b %e %T %Y)
  68. %D - Date (%m/%d/%y)
  69. %F - ISO 8601 date format (%Y-%m-%d)
  70. %v - VMS date (%e-%b-%Y)
  71. %x - Same as %D
  72. %X - Same as %T
  73. %r - 12-hour time (%I:%M:%S %p)
  74. %R - 24-hour time (%H:%M)
  75. %T - 24-hour time (%H:%M:%S)
  76. %+ - date(1) (%a %b %e %H:%M:%S %Z %Y)
  77. The modifiers ``E'' and ``O'' are ignored.
  78. */
  79. package strftime