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 Returns SampleSorted ascending
I ?? DST flag?? 0
n Month (numeric) 2
m Month (numeric, 2 digit) 02
G Hour (12 hour) 5
H Hour (12 hour, 2 digit) 05
w Day of the week (numeric) 6
y Year (short) 17
h Hour (24 hour) 17
g Hour (24 hour, 2 digit?) 17
d Day of the month 18
e Day of the month (2 digit?) 18
s Seconds 32
i Minutes 39
j Day of the year 49
Y Year (long) 2017
u ?? Large number 273668
x Seconds since Epoch 1487458243
M Month (short) Feb
F Month (long) February
p am/pm (lowercase) pm
P am/pm (uppercase) PM
D Day of the week (short) Sat
W Day of the week (long) Saturday
S DoM suffex th
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