{$variable|jrCore_format_time}

Applies to: Jamroom 7.0+ Last verified: 2026-10-24
  • jrCore_format_time

    Function
    jrCore_format_time
    parameter
    type
    default
    required
    description
    (1) date_only
    bool
    false
    off
    true shows only the date, without the time
    (2) format
    string
    -
    off
    A date format, or "relative". Without it: the date and time formats in System Core's Global Config.
    (3) adjust
    bool
    true
    off
    false skips the daylight saving adjustment

    Shows a timestamp, such as _created, as a readable date in the site's time zone.

    {$item._created|jrCore_format_time}                      {* the site's date and time format *}
    {$item._created|jrCore_format_time:true}                 {* the date only *}
    {$item._created|jrCore_format_time:false:"relative"}     {* 3 days ago, in 2 hours *}
    {$item._created|jrCore_format_time:false:"%Y-%m-%d"}     {* 2026-10-24 *}
    {$item._created|jrCore_format_time:false:"F j, Y"}       {* October 24, 2026 *}
  • Formats

    The format can use PHP date() letters, such as Y-m-d, or these older % codes, which are converted to them: %Y %y %m %d %e %B %b %A %a %H %k %I %l %M %S %p %P %D %T %F %x %r %u %w %V %z.

    relative shows the time from now in words, from the System Core language strings: "5 minutes ago", "in 2 days".

    The site's default formats are Date Format and Hour Format in ACP > Modules > Core > System Core > Global Config.

Tags