Date and time format

In Dotclear's configuraion or in some template markers, you can specify a specific date and time format. This format follows the rules of the strftime function. Par exemple, pour afficher "jeudi 9 novembre 1989" on utilisera le masque %A %e %B %Y.

Here are possible formats:

  • %a - abbreviated name of the day of the week (local).
  • %A - full name of the day of the week (local).
  • %b - abbreviated name of the month (local).
  • %B - full name of the month (local).
  • %c - preferred representation of dates and times, local.
  • %C - number of the century (the year, divided by 100 and rounded to 00 though 99)
  • %d - day of the month (2 digits, interval 01 to 31)
  • %D - identical to %m/%d/%y
  • %e - day of the month, digits are preceded with a space (from ' 1' to '31')
  • %h - identical to %b
  • %H - time of the day (digits) and on 24hrs (interval from 00 to 23)
  • %I - time of the day (digits) and on 12hrs (interval from 01 to 12)
  • %j - day of the year (digits, interval 001 to 366)
  • %m - month (digits) (interval 1 to 12)
  • %M - minutes (digits)
  • %n - break line
  • %p - either `am' or `pm' depending on the absolute time, or depending on the locally registered values.
  • %r - time in the a.m. and p.m. format.
  • %R - time in a 24h format
  • %S - seconds (digits)
  • %t - tab
  • %T - current time (identical to %H:%M:%S)
  • %u - day number in the week, from 1 to 7, 1 being Monday.
  • %U - number of the week in the year, considering the first Sunday of the year as the first day of the first week.
  • %V - The week number following ISO 8601:1988 specifications, in a decimal form (01 to 53). Week 1 is the first week that has more than 4 days in the current year and of which Monday is the first day.
  • %W - week number in the year, taking the first Monday of the year as the first day of the the first week
  • %w - day of the week (digits) with Sunday=0
  • %x - preferred format of date representation without the time
  • %X - preferred format of date representation without the date
  • %y - year, 2 digits (00 to 99)
  • %Y - year, 4 digits
  • %Z - timezone, or name or abbreviation
  • %% - a litteral `%' character

Wiki powered by Dokuwiki.