Skip to main content

Examples

All examples on this page assume that the current time is Sunday 28 August 2022, 21:45:30.

Predefined formats

  • {TIME;@YYYY-MM-DD}
    "2022-08-28"
  • {TIME;@DD/MM/YY}
    "28/08/22"

Individual components

  • {DAYOFMONTH}/{MONTH}/{YEAROFCENTURY}
    "28/08/22" — the same result as {TIME;@DD/MM/YY} above, built from components.
  • {HOUR}:{MINUTE}
    "21:45" — components are zero-padded to their natural width by default.
  • {YEAR} week {WEEK}
    "2022 week 34"
  • {TIME;{HOUR12}:{MINUTE}{AMPM}}
    "09:45PM" — 12-hour time with an AM/PM suffix.
  • {TIME;{HOUR12}:{MINUTE}{AMPM;FORMAT={ a.m.; p.m.}}}
    "09:45 p.m." — the same, but with custom AM/PM texts.

Custom number formats

  • {MONTH;FORMAT=shortmonth}
    "AUG" — the built-in shortmonth format prints month names.
  • {TIME;{MONTH;FORMAT={A;B;C;D;E;F;G;H;J;K;L;M}}}
    "H" — the month picked from a custom list, A for January through M for December (skipping I). August is the eighth entry.

Offsets

  • {TIME;@YYYY-MM-DD;+20days}
    "2022-09-17" — a best before date 20 days from now.
  • {TIME;@YYYY-MM-DD;+3months-1week}
    "2022-11-21" — offset terms can be combined.
  • {TIME;{MONTH;FORMAT=shortmonth};+6weeks}
    "OCT" — the month name six weeks from now.
  • {TIME;{YEAR}{DAYOFYEAR};+1month}
    "2022271" — the Julian date one month from now.
  • {TIME;@YYYY-MM-DD;+{VARIABLE;SHELF_LIFE}days}
    A best before date where the number of days is taken from the variable SHELF_LIFE. If the variable is "14", the result is "2022-09-11".

Clocks

These examples use a custom clock named PRODDATE set to 16 May 2022.

  • {TIME;@YYYY-MM-DD;;PRODDATE}
    "2022-05-16" — the clock value instead of the current time. Note the empty offset argument.
  • {TIME;@YYYY-MM-DD;+6months;PRODDATE}
    "2022-11-16" — a best before date six months after the production date.