You are here: Foswiki>System Web>Macros>VarGMTIME (revision 1)EditAttach

GMTIME{"format"} -- formatted GM time

  • Syntax: %GMTIME% OR %GMTIME{"format"}%
  • %GMTIME% uses the default date format defined by the {DefaultDateFormat} setting in configure
    • expands to 28 Mar 2024 - 22:20
  • Supported special format tokens:
    Token: Unit:Sorted ascending Example
    $mo 2 digit month 12
    $ye 2 digit year 99
    $year 4 digit year 1999
    $day day of month 31
    $dow day of the week (Sun = 0) 2
    $wday day of the Week (Sun, Mon, Tue, Wed, Thu, Fri, Sat) Thu
    $http E-mail & http format timestamp Thu, 28 Mar 2024 22:20:22 GMT
    $tz either "GMT" (if set to gmtime), or "Local" (if set to servertime) GMT
    $hours hours 23
    $iso ISO format timestamp 2024-03-28T22:20:22Z
    $minutes minutes 59
    $epoch Number of seconds since 00:00 on 1st January, 1970 1711664422
    $week number of week in year (ISO 8601) 34
    $rcs RCS format timestamp 2024/03/28 22:20:22
    $seconds seconds 59
    $month short name of month Dec
  • Tokens can be shortened to 3 characters
  • Example:
    %GMTIME{"$day $month, $year - $hour:$min:$sec"}%
    expands to
    28 Mar, 2024 - 22:20:22
    ALERT! When used in a template topic, this macro will be expanded when the template is used to create a new topic. See TemplateTopics#TemplateTopicsVars for details.
  • Related: GMTIME, REVINFO, SERVERTIME
Topic revision: r1 - 19 Sep 2010, ProjectContributor
 
This site is powered by FoswikiCopyright © CC-BY-SA by the contributing authors. All material on this collaboration platform is copyrighted under CC-BY-SA by the contributing authors unless otherwise noted.
Ideas, requests, problems regarding Foswiki? Send feedback