TinyMARE HelpText

Global Functions > Timefmt()

Timefmt()

timefmt(<format>, <time>)

Powers: Functions

Returns <time> as a formatted string as described in <format>. <time> is in the format of seconds, typically seconds since Unix Epoch. <format> contains one or more letters describing the format of the string to be returned. timefmt() is frequently used with xtime() to format the current date and time, but it can be used with anything that generates a value in seconds.

Format Characters

Character ReturnsSorted ascending Sample
I ?? DST flag?? 0
u ?? Large number 273668
p am/pm (lowercase) pm
P am/pm (uppercase) PM
d Day of the month 18
e Day of the month (2 digit?) 18
W Day of the week (long) Saturday
w Day of the week (numeric) 6
D Day of the week (short) Sat
j Day of the year 49
S DoM suffex th
G Hour (12 hour) 5
H Hour (12 hour, 2 digit) 05
h Hour (24 hour) 17
g Hour (24 hour, 2 digit?) 17
i Minutes 39
F Month (long) February
n Month (numeric) 2
m Month (numeric, 2 digit) 02
M Month (short) Feb
s Seconds 32
x Seconds since Epoch 1487458243
Y Year (long) 2017
y Year (short) 17
Example:
  [timefmt({W, F n, Y},xtime())]   => 'Saturday, February 2, 2017'

See also: xtime(), time(), tma(), tmf(), tml(), tms()

From the TinyMARE Help command - Courtesy Gandalf

-- SluggyQBFreak - 18 Feb 2017
Topic revision: r1 - 18 Feb 2017, SluggyQBFreak
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding WikiMARE? Send feedback