Date Class extending Object

/ Respresents a given date and time. Allows formatting and the ability to get a formatted string of the specified time based on the format provided. Simply put this handles all Date related operations /

Class Methods

The constructor accepts a number which represents a unix timestamp. This will be used by the date object

function __construct(number unix_timestamp) : void


Sets the current timezone based on the timezone abbreviation that is used. For example "UTC+0:00"

function setTimezone(string abbreviation) : void

Sets the format for this date
%a Abbreviated weekday name Sun
%A Full weekday name Sunday
%b Abbreviated month name Mar
%B Full month name March
%c Date and time representation Sun Aug 19 02:56:02 2012
%d Day of the month (01-31) 19
%H Hour in 24h format (00-23) 14
%I Hour in 12h format (01-12) 05
%j Day of the year (001-366) 231
%m Month as a decimal number (01-12) 08
%M Minute (00-59) 55
%p AM or PM designation PM
%S Second (00-61) 02
%U Week number with the first Sunday as the first day of week one (00-53) 33
%w Weekday as a decimal number with Sunday as 0 (0-6) 4
%W Week number with the first Monday as the first day of week one (00-53) 34
%x Date representation 08/19/12
%X Time representation 02:50:06
%y Year, last two digits (00-99) 01
%Y Year 2012
%Z Timezone name or abbreviation CDT
%% A % sign %
Example: %d-%M-%Y may equal 01-01-2018 if the date points to this the time 01-01-2018.
Use getFormattedString() to get the date in the format you provided here

function setFormat(string format) : void


Returns this date as a formatted string based on the format you specified with setFormat

function getFormattedString() : string

Sets the current hour for this date
Setting the hour over the amount of hours left of this day will cause the time to roll over to the next day

function setHour(number hour) : void


Sets the current minute for this date
Setting the minutes over the amount of minutes left of this hour will cause the time to roll over to the next hour

function setMinute(number hour) : void

Sets the current second for this date
Setting the seconds over the amount of seconds of this minute left will cause the time to roll over to the next minute

function setSecond(number second) : void


Sets the current day for this date.
Setting over the current amount of days for that month will cause the time to rollover to the following month

function setDay(number day) : void

Sets the current month for this date
Setting the current amount of months over the current year will cause the time to rollover to the following year

function setMonth(number month) : void


Sets the current year for this date.

function setYear(number year) : void

Gets the current hour for this date

function getHour() : number


Gets the current minute for this date

function getMinute() : number

Gets the current second for this date

function getSecond() : number


Gets the current day for this date

function getDay() : number

Gets the current month for this date

function getMonth() : number


Gets the current year for this date

function getYear() : number