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