logo
Home XtGem- Templates- XtScript- bottom

Time and date

Add block >Utilities >Time and date
This function returns the current SERVER time offset by your timezone in various formats
yyyy-mm-dd
<xt:tdate format="Y-m-d" tzone="0" />

2018-04-21
hh:mm
<xt:tdate format="H:i" tzone="0" />

09:45
yyyy-m-dd hh:mm:ss
<xt:tdate format="Y-m-d H:i:s" tzone="0" />

2018-04-21 09:45:04
yy/mm/dd
<xt:tdate format="y/m/d" tzone="0" />

18/04/21
dd/mm/yy
<xt:tdate format="d/m/y" tzone="0" />

21/04/18
mm/dd/yy
<xt:tdate format="m/d/y" tzone="0" />

04/21/18
LIST OF FORMAT OPTIONS
A = AM/PM (AM)
a=am/pm (am)
B = Swatch internet time (447)
c = full (2018-04-21T09:45:04+00:00)
D = day of week (Sat)
d = day of month (21)
e = timezone (GMT)
F = name of month (April)
g = hour (9) (12 hr no leading 0)
h = hour (09) (12hr leading 0)
G = hour (9) (24hr no leading 0)
H = hour (09) (24hr leading 0)
i = minutes (45)
I = daylight saving (0) (1=yes 0=no)
j = day of month (21) (no leading 0)
l = day of week (Saturday)
L = leapyear (1=yes 0=no) (0)
M = name of month (Apr)
m = month (04) (leading 0)
n = month (4) (no leading 0)
N = day (1=mon 7=sun) (6)
w = day (sun=0 sat=6) (6)
r = full (Sat, 21 Apr 2018 09:45:04 +0000)
S = type of date (1st 2nd 3rd 4th) (st)
s = seconds (04)
T = timezone abbrv (GMT)
t = days in month (30)
U = seconds since 1/1/1970 (1524303904)
W = week number (16)
y = year (18)
Y = year (2018)
z = days (0=jan 1) (110)
O = difference from GMT in hours (+0000)
P = same with a colon (+00:00)
u = Microseconds (000000)
Powered by XtGem
About us Contact Forum top