Skip to content

Supported date time formats

Nick Korotysh edited this page Jan 16, 2024 · 2 revisions

Clock uses date/time formatting provided by Qt, but with few exceptions/extensions:

  • h (and hh) means 12-hour format in any case, regardless of AM/PM symbol presence
  • J - day of year, 0-365 (366), no leading zeroes are supported
  • W - week number, 0-53, no leading zero, WW - with leading zero (e.g. 08)
  • : has special meaning, use it to specify separator (aka "dot" which should be animated)
  • any of special characters (including :) can be escaped with \ (backslash) and then be used as regular characters
  • anything in single quotes (') is interpreted as is, but escape sequences (e.g. \n) still be interpreted
  • use \\ ("escaped backslash") to get \ and \' ("escaped single quote") to get '

The rest is delegated to Qt, see Qt documentation for supported date and time formats. Day and month names are localized, some other locale-specific date/time formatting is also preserved.

Clone this wiki locally