| $date(Format[, time])
This function is very similar to the date function in php.
It will take the specified time in seconds since the Unix Epoch, and convert it to
the format specified.
If no time is specified, it will use the current time. Any letter in the Format
that is not recognized will be output as-is. You may also escape letters with '\'. The following
letters are recognized (note they are case sensitive):
a - am or pm
A - AM or PM
d - Day of the month, 2 digits with leading zeros (01, 02)
D - name of the day of the week, three letters (Sun, Mon, etc.)
F - Full month name (January, February, etc.)
g - 12-hour format of an hour without leading zeros
G - 24-hour format of an hour without leading zeros
h - 12-hour format of an hour with leading zeros
H - 24-hour format of an hour with leading zeros
i - Minutes with leading zeros
I - 1 or 0 depending if the date is in daylight savings time
j - Day of the month without leading zeros
l - Full day of the week name (Sunday, Monday, etc.)
m - Numeric representation of a month, with leading zeros
M - Three letter month name (Jan, Feb, etc.)
n - Numeric representation of a month, without leading zeros
O - Difference to Greenwich time (GMT) in hours (+0200)
r - RFC 822 formatted date (Thu, 21 Dec 2000 16:01:07 +0200)
s - Seconds, with leading zeros
S - English ordinal suffix for the day of the month (st, rd, th, etc.)
U - Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
w - Numeric representation of the day of the week (0 = Sunday, 1= Monday)
Y - A full numeric representation of a year, 4 digits (2003, 2004)
y - Numeric representation of the year, 2 digits (03, 04)
z - The day of the year (0, 1, 366)
Z - Timezone offset in seconds. (-43200, 43200)
Example:
| $date() example |
# Creates a player command, !firstplayed that shows them when they first played # something like: * You first played here on Jan 18, 2002 at 9:23:36 AM
# The time here isnt very intuitive, its taking the time that they got the highest # number of serverjoins in a game, which would be 1, the first time they played.
on pcmd_firstplayed cmd /say_resp * You first played here on $date("M j, Y \\a\\t g:i:s A", $pa-time-serverjoin);
|
|
|