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