DateJS Public Instance Methods
Adds(or subtracts) to the value of the year, month, day, hour, minute, second, millisecond of the date instance using given configuration object. Positive and Negative values allowed.
Adds the specified number of days to this instance.The number can be positive or negative.
Adds the specified number of hours to this instance given the number of hours to add.The number can be positive or negative.
Adds the specified number of milliseconds to this instance.
Adds the specified number of minutes to this instance given the number of minutes to add.The number can be positive or negative.
Adds the specified number of months to this instance given the number of months to add.The number can be positive or negative.
Adds the specified number of seconds to this instance given the number of seconds to add.The number can be positive or negative.
Adds the specified number of weeks to this instance given the number of weeks to add.The number can be positive or negative.
Adds the specified number of years to this instance given the number of years to add.The number can be positive or negative.
Determines if this instance is between a range of two dates or equal to either the start or end dates.
boolean
Resets the time of this Date object to 12:00 AM(00:00), which is the start of the day.
Returns a new Date object that is an exact date and time copy of the original instance.
Compares this instance to a Date object and returns an number indication of their relative values. -1 = this is lessthan date. 0 = values are equal. 1 = this is greaterthan date.
number
Compares this instance to another Date object and returns true if they are equal, otherwise false.
boolean
Gets the day-of-the-month, using local time.
number
Gets the day of the week, using local time.
number
Returns the number of milliseconds between this date and date.
number
Gets the year, using local time.
number
Gets the hours in a date, using local time.
number
Get the ISO 8601 week number. Week one ("01") is the week which contains the first Thursday of the year. Monday is considered the first day of the week.
string
Gets the milliseconds of a Date, using local time.
number
Gets the minutes of a Date object, using local time.
number
Gets the month, using local time.
number
Get the Ordinal day (numeric day number) of the year, adjusted for leap year. Returns 1 through 365 (366 in leap years)
number
Gets the seconds of a Date object, using local time.
number
Gets the time value in milliseconds.
number
Get the timezone abbreviation of the current date.
string
Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC).
number
Gets the day-of-the-month, using Universal Coordinated Time (UTC).
number
Gets the day of the week using Universal Coordinated Time (UTC).
number
Gets the year using Universal Coordinated Time (UTC).
number
Gets the hours value in a Date object using Universal Coordinated Time (UTC).
number
Gets the milliseconds of a Date object using Universal Coordinated Time (UTC).
number
Gets the minutes of a Date object using Universal Coordinated Time (UTC).
number
Gets the month of a Date object using Universal Coordinated Time (UTC).
number
Get the offset from UTC of the current date. Returns the 4-character offset string prefixed with + or - (e.g. "-0500").
string
Gets the seconds of a Date object using Universal Coordinated Time (UTC).
number
Get the week number. Week one (1) is the week which contains the first Thursday of the year. Monday is considered the first day of the week.
number
Indicates whether Daylight Saving Time is observed in the current time zone.
boolean
Determines if this date occurs after the date to compare to.
boolean
Determines if this date occurs before the date to compare to.
boolean
Indicates whether this Date instance is within the Daylight Saving Time range for the current time zone.
boolean
Determines if the current Date instance occurs on the same Date as the supplied 'date'.
boolean
Move to the next or previous dayOfWeek. Whether to move into the future (+1) or past(-1) is controlled by the optional direction parameter.
Moves the date to the first day of the month.
Moves the date to the last day of the month.
Move to the next or previous month.Whether to move into the future(+1) or past(-1) is controlled by the optional direction parameter.
Moves the date to the next nth occurrence of the dayOfWeek starting from the beginning of the month. The number (-1) is a magic number and will return the last occurrence of the dayOfWeek in the month.
Set the value of year, month, day, hour, minute, second, millisecond of date instance using given configuration object.
Sets the numeric day-of-the-month value of the Date object using local time.
A numeric value equal to the day of the month.
number
Sets the year of the Date object using local time.
A numeric value for the year.
A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.
A numeric value equal for the day of the month.
number
Sets the hour value in the Date object using local time.
A numeric value equal to the hours value.
A numeric value equal to the minutes value.
A numeric value equal to the seconds value.
A numeric value equal to the milliseconds value.
number
Sets the milliseconds value in the Date object using local time.
A numeric value equal to the millisecond value.
number
Sets the minutes value in the Date object using local time.
A numeric value equal to the minutes value.
A numeric value equal to the seconds value.
A numeric value equal to the milliseconds value.
number
Sets the month value in the Date object using local time.
A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.
A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.
number
Sets the seconds value in the Date object using local time.
A numeric value equal to the seconds value.
A numeric value equal to the milliseconds value.
number
Sets the date and time value in the Date object.
A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT.
number
Resets the time of this Date object to the current time('now').
Set the timezone for the current date using a culture - specific timezone abbreviation("PST").Note that in most JavaScript implementations, this will appear to change the time since the timezone is always based on the locale.
Set the timezone for the current date using an offset(-0700).Note that in most JavaScript implementations, this will appear to change the time since the timezone is always based on the locale.
Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).
A numeric value equal to the day of the month.
number
Sets the year value in the Date object using Universal Coordinated Time (UTC).
A numeric value equal to the year.
A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.
A numeric value equal to the day of the month.
number
Sets the hours value in the Date object using Universal Coordinated Time (UTC).
A numeric value equal to the hours value.
A numeric value equal to the minutes value.
A numeric value equal to the seconds value.
A numeric value equal to the milliseconds value.
number
Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).
A numeric value equal to the millisecond value.
number
Sets the minutes value in the Date object using Universal Coordinated Time (UTC).
A numeric value equal to the minutes value.
A numeric value equal to the seconds value.
A numeric value equal to the milliseconds value.
number
Sets the month value in the Date object using Universal Coordinated Time (UTC).
A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.
A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.
number
Sets the seconds value in the Date object using Universal Coordinated Time (UTC).
A numeric value equal to the seconds value.
A numeric value equal to the milliseconds value.
number
Moves the date to Monday of the week set. Week one (1) is the week which contains the first Thursday of the year.
Returns a date as a string value.
string
Converts the current date instance into a string with an ISO 8601 format.The date is converted to it's UTC value. As per the ISO 8601 specification, the string will be wrapped with double quotation marks (").
string
Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization.
string
Returns a date as a string value appropriate to the host environment's current locale.
string
Returns a value as a string value appropriate to the host environment's current locale.
string
Returns a time as a string value appropriate to the host environment's current locale.
string
Converts the value of the current Date object to its equivalent string representation.Use format argument to specify format(optional).See FormatSpecifiers for more info.
string
Returns a time as a string value.
string
Returns a date converted to a string using Universal Coordinated Time (UTC).
string
Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC.
number