|
| add( String interval , Number value )
+ :
+ DateProvides a convenient method for performing basic date arithmetic. This method
does not modify the Date instance bein... Provides a convenient method for performing basic date arithmetic. This method
does not modify the Date instance being called - it creates and returns
a new Date instance containing the resulting date value.
@@ -195,16 +195,16 @@ document.write(dt2); //returns 'Tue Sep 26 2006 00:00:00'
// You can even chain several calls together in one line:
var dt3 = new Date( '10/1/2006').add(Date.DAY, 5).add(Date.HOUR, 8).add(Date.MINUTE, -30);
-document.write(dt3); //returns 'Fri Oct 06 2006 07:30:00'Parameters:Returns:Date The new Date instance.
| Date |
| between( Date start , Date end )
- :
- BooleanChecks if this date falls on or between the given start and end dates. Checks if this date falls on or between the given start and end dates. Parameters:start : DateStart date end : DateEnd date Returns: | Date |
| clearTime( Boolean clone )
- :
- DateAttempts to clear all time information from this Date by setting the time to midnight of the same day,
+document.write(dt3); //returns 'Fri Oct 06 2006 07:30:00'Parameters:Returns:Date The new Date instance.
| Date |
| between( Date start , Date end )
+ :
+ BooleanChecks if this date falls on or between the given start and end dates. Checks if this date falls on or between the given start and end dates. Parameters:start : DateStart date end : DateEnd date Returns: | Date |
| clearTime( Boolean clone )
+ :
+ DateAttempts to clear all time information from this Date by setting the time to midnight of the same day,
automatically ... Attempts to clear all time information from this Date by setting the time to midnight of the same day,
automatically adjusting for Daylight Saving Time (DST) where applicable.
-(note: DST timezone information for the browser's host operating system is assumed to be up-to-date) | Date |
| clone()
- :
- DateCreates and returns a new Date instance with the exact same date value as the called instance.
+(note: DST timezone information for the browser's host operating system is assumed to be up-to-date) | Date |
| clone()
+ :
+ DateCreates and returns a new Date instance with the exact same date value as the called instance.
Dates are copied and p... Creates and returns a new Date instance with the exact same date value as the called instance.
Dates are copied and passed by reference, so if a copied date variable is modified later, the original
variable will also be changed. When the intention is to create a new variable that will not
@@ -220,72 +220,72 @@ document.write(orig); //returns 'Thu Oct 05 2006'!
var orig = new Date( '10/1/2006');
var copy = orig.clone();
copy.setDate(5);
-document.write(orig); //returns 'Thu Oct 01 2006'Parameters:Returns:Date The new Date instance.
| Date |
| format( String format )
- :
- StringFormats a date given the supplied format string. Formats a date given the supplied format string. Parameters:format : StringThe format string. Returns:String The formatted date.
| Date |
| getDayOfYear()
- :
- NumberGet the numeric day number of the year, adjusted for leap year. Get the numeric day number of the year, adjusted for leap year. | Date |
| getDaysInMonth()
- :
- NumberGet the number of days in the current month, adjusted for leap year. Get the number of days in the current month, adjusted for leap year. | Date |
| getElapsed( [Date date ] )
- :
- NumberReturns the number of milliseconds between this date and date Returns the number of milliseconds between this date and date Parameters:Returns:Number The diff in milliseconds
| Date |
| getFirstDateOfMonth()
- :
- DateGet the date of the first day of the month in which this date resides. Get the date of the first day of the month in which this date resides. | Date |
| getFirstDayOfMonth()
- :
- NumberGet the first day of the current month, adjusted for leap year. The returned value
+document.write(orig); //returns 'Thu Oct 01 2006'Parameters:Returns:Date The new Date instance.
| Date |
| format( String format )
+ :
+ StringFormats a date given the supplied format string. Formats a date given the supplied format string. Parameters:format : StringThe format string. Returns:String The formatted date.
| Date |
| getDayOfYear()
+ :
+ NumberGet the numeric day number of the year, adjusted for leap year. Get the numeric day number of the year, adjusted for leap year. | Date |
| getDaysInMonth()
+ :
+ NumberGet the number of days in the current month, adjusted for leap year. Get the number of days in the current month, adjusted for leap year. | Date |
| getElapsed( [Date date ] )
+ :
+ NumberReturns the number of milliseconds between this date and date Returns the number of milliseconds between this date and date Parameters:Returns:Number The diff in milliseconds
| Date |
| getFirstDateOfMonth()
+ :
+ DateGet the date of the first day of the month in which this date resides. Get the date of the first day of the month in which this date resides. | Date |
| getFirstDayOfMonth()
+ :
+ NumberGet the first day of the current month, adjusted for leap year. The returned value
is the numeric day index within t... Get the first day of the current month, adjusted for leap year. The returned value
is the numeric day index within the week (0-6) which can be used in conjunction with
the monthNames array to retrieve the textual day name.
Example:
var dt = new Date('1/10/2007');
-document.write(Date.dayNames[dt.getFirstDayOfMonth()]); //output: 'Monday'
Parameters:Returns:Number The day number (0-6).
| Date |
| getGMTOffset( [Boolean colon ] )
- :
- StringGet the offset from GMT of the current date (equivalent to the format specifier 'O'). Get the offset from GMT of the current date (equivalent to the format specifier 'O'). | Date |
| getLastDateOfMonth()
- :
- DateGet the date of the last day of the month in which this date resides. Get the date of the last day of the month in which this date resides. | Date |
| getLastDayOfMonth()
- :
- NumberGet the last day of the current month, adjusted for leap year. The returned value
+document.write(Date.dayNames[dt.getFirstDayOfMonth()]); //output: 'Monday'Parameters:Returns:Number The day number (0-6).
| Date |
| getGMTOffset( [Boolean colon ] )
+ :
+ StringGet the offset from GMT of the current date (equivalent to the format specifier 'O'). Get the offset from GMT of the current date (equivalent to the format specifier 'O'). | Date |
| getLastDateOfMonth()
+ :
+ DateGet the date of the last day of the month in which this date resides. Get the date of the last day of the month in which this date resides. | Date |
| getLastDayOfMonth()
+ :
+ NumberGet the last day of the current month, adjusted for leap year. The returned value
is the numeric day index within th... Get the last day of the current month, adjusted for leap year. The returned value
is the numeric day index within the week (0-6) which can be used in conjunction with
the monthNames array to retrieve the textual day name.
Example:
var dt = new Date('1/10/2007');
-document.write(Date.dayNames[dt.getLastDayOfMonth()]); //output: 'Wednesday'
Parameters:Returns:Number The day number (0-6).
| Date |
| getMonthNumber( String name )
- :
- Number<static> Get the zero-based javascript month number for the given short/full month name.
+document.write(Date.dayNames[dt.getLastDayOfMonth()]); //output: 'Wednesday'Parameters:Returns:Number The day number (0-6).
| Date |
| getMonthNumber( String name )
+ :
+ Number<static> Get the zero-based javascript month number for the given short/full month name.
Override this function for internatio... <static> Get the zero-based javascript month number for the given short/full month name.
-Override this function for international dates. | Date |
| getShortDayName( Number day )
- :
- String<static> Get the short day name for the given day number.
+Override this function for international dates. | Date |
| getShortDayName( Number day )
+ :
+ String<static> Get the short day name for the given day number.
Override this function for international dates. <static> Get the short day name for the given day number.
-Override this function for international dates. Parameters:Returns:String The short day name.
| Date |
| getShortMonthName( Number month )
- :
- String<static> Get the short month name for the given month number.
+Override this function for international dates. Parameters:Returns:String The short day name.
| Date |
| getShortMonthName( Number month )
+ :
+ String<static> Get the short month name for the given month number.
Override this function for international dates. <static> Get the short month name for the given month number.
-Override this function for international dates. Parameters:Returns:String The short month name.
| Date |
| getSuffix()
- :
- StringGet the English ordinal suffix of the current day (equivalent to the format specifier 'S'). Get the English ordinal suffix of the current day (equivalent to the format specifier 'S'). Parameters:Returns:String 'st, 'nd', 'rd' or 'th'.
| Date |
| getTimezone()
- :
- StringGet the timezone abbreviation of the current date (equivalent to the format specifier 'T').
+Override this function for international dates. Parameters:Returns:String The short month name.
| Date |
| getSuffix()
+ :
+ StringGet the English ordinal suffix of the current day (equivalent to the format specifier 'S'). Get the English ordinal suffix of the current day (equivalent to the format specifier 'S'). Parameters:Returns:String 'st, 'nd', 'rd' or 'th'.
| Date |
| getTimezone()
+ :
+ StringGet the timezone abbreviation of the current date (equivalent to the format specifier 'T').
Note: The date string ret... Get the timezone abbreviation of the current date (equivalent to the format specifier 'T').
Note: The date string returned by the javascript Date object's toString() method varies
between browsers (e.g. FF vs IE) and system region settings (e.g. IE in Asia vs IE in America).
For a given date string e.g. "Thu Oct 25 2007 22:55:35 GMT+0800 (Malay Peninsula Standard Time)",
getTimezone() first tries to get the timezone abbreviation from between a pair of parentheses
(which may or may not be present), failing which it proceeds to get the timezone abbreviation
-from the GMT offset portion of the date string. | Date |
| getWeekOfYear()
- :
- NumberGet the numeric ISO-8601 week number of the year.
+from the GMT offset portion of the date string. | Date |
| getWeekOfYear()
+ :
+ NumberGet the numeric ISO-8601 week number of the year.
(equivalent to the format specifier 'W', but without a leading zero... Get the numeric ISO-8601 week number of the year.
-(equivalent to the format specifier 'W', but without a leading zero). | Date |
| isDST()
- :
- BooleanChecks if the current date is affected by Daylight Saving Time (DST). Checks if the current date is affected by Daylight Saving Time (DST). | Date |
| isLeapYear()
- :
- BooleanChecks if the current date falls within a leap year. Checks if the current date falls within a leap year. | Date |
| isValid( Number year , Number month , Number day , [Number hour ], [Number minute ], [Number second ], [Number millisecond ] )
- :
- Boolean<static> Checks if the passed Date parameters will cause a javascript Date "rollover". <static> Checks if the passed Date parameters will cause a javascript Date "rollover". Parameters:year : Number4-digit year month : Number1-based month-of-year day : NumberDay of month hour : Number(optional) Hour minute : Number(optional) Minute second : Number(optional) Second millisecond : Number(optional) Millisecond Returns: | Date |
| parseDate( String input , String format , [Boolean strict ] )
- :
- Date<static> Parses the passed string using the specified date format.
+(equivalent to the format specifier 'W', but without a leading zero). | Date |
| isDST()
+ :
+ BooleanChecks if the current date is affected by Daylight Saving Time (DST). Checks if the current date is affected by Daylight Saving Time (DST). | Date |
| isLeapYear()
+ :
+ BooleanChecks if the current date falls within a leap year. Checks if the current date falls within a leap year. | Date |
| isValid( Number year , Number month , Number day , [Number hour ], [Number minute ], [Number second ], [Number millisecond ] )
+ :
+ Boolean<static> Checks if the passed Date parameters will cause a javascript Date "rollover". <static> Checks if the passed Date parameters will cause a javascript Date "rollover". Parameters:year : Number4-digit year month : Number1-based month-of-year day : NumberDay of month hour : Number(optional) Hour minute : Number(optional) Minute second : Number(optional) Second millisecond : Number(optional) Millisecond Returns: | Date |
| parseDate( String input , String format , [Boolean strict ] )
+ :
+ Date<static> Parses the passed string using the specified date format.
Note that this function expects normal calendar dates, mean... <static> Parses the passed string using the specified date format.
Note that this function expects normal calendar dates, meaning that months are 1-based (i.e. 1 = January).
The defaults hash will be used for any date value (i.e. year, month, day, hour, minute, second or millisecond)
|