date()

This function returns the Date object. You may optionally use a timestamp with this function in the format date(timestamp). If timestamp is not supplied then the current timestamp is used. The timestamp is the number of milliseconds that have passed since January 1st, 1970 at 00:00:00.

The bot will internally apply the toString() method to it when date() is used in a manner that should return a string, for example echo date().
If used in a method that would need a number, for example x = date() / 1000 then the bot will internally apply the toNumber() method to it.

Example:

Example:

Example:

Methods to use with date()

date().getTime() //returns current timestamp as a number rather than string as shown above.

date(timestamp).getMonth() // returns the month (integer number) for specified timestamp (or current time if timestamp is omitted). It starts counting at 0 for January and ends at 11 for December.

date(timestamp).getDate() // returns the day of the month (integer number) for specified timestamp (or current time if timestamp is omitted).

date(timestamp).getDay() // returns the day of the week (integer number) for specified timestamp (or current time if timestamp is omitted). It starts counting at 0 for Sunday and ends at 6 for Saturday.

date(timestamp).getFullYear() // returns the year (integer number) for specified timestamp (or current time if timestamp is omitted).

date(timestamp).getHours() // returns hour (integer number) for specified timestamp (or current time if timestamp is omitted).

date(timestamp).getMinutes() // returns minutes (integer number) for specified timestamp (or current time if timestamp is omitted).

date(timestamp).getSeconds() // returns seconds (integer number) for specified timestamp (or current time if timestamp is omitted).


CategoryFunctions

date (last edited 2015-08-19 21:37:29 by Inanna)