Methods and Properties of the Date Object : JavaScript DHTML examples (example source code) » Development » Date

JavaScript DHTML
C++
Java Products
Java Articles
JavaScript DHTML Home  »   Development   » [  Date  ]   
 



Methods and Properties of the Date Object


/*
JavaScript Unleashed, Third Edition
by Richard Wagner and R. Allen Wyke 

ISBN: 067231763X
Publisher Sams CopyRight 2000



+-----------+----------------+---------------------------------------------------+
   Type       Item             Description
+-----------+----------------+---------------------------------------------------+
   Method
+-----------+----------------+---------------------------------------------------+
              getDate()        Returns the date within month (1 to 31).
+-----------+----------------+---------------------------------------------------+
              getDay()         Returns the day within the week (0 to 6).
+-----------+----------------+---------------------------------------------------+
              getFullYear()    Returns the year in local time with four digits. 
                               This method was added in JavaScript 1.2.
+-----------+----------------+---------------------------------------------------+
              getHours()       Returns the hour within the day (0 to 23).
+-----------+----------------+---------------------------------------------------+    
            getMilliseconds()  Returns the milliseconds. This method was added in 
                               JavaScript 1.2.
+-----------+----------------+---------------------------------------------------+
             getMinutes()      Returns the minutes within the hour (0 to 59).
+-----------+----------------+---------------------------------------------------+
             getMonth()        Returns the month within the year (0 to 11).
+-----------+----------------+---------------------------------------------------+
             getSeconds()      Returns seconds within the minute (0 to 59).
+-----------+----------------+---------------------------------------------------+
             getTime()         Returns the number of milliseconds since 1/1/70 00:00:00.
+-----------+----------------+---------------------------------------------------+
          getTimeZoneOffset()  Returns minutes offset from GMT/UTC.
+-----------+----------------+---------------------------------------------------+
             getUTCDate()      Returns the day of the month. This method was added 
                               in JavaScript 1.2.
+-----------+----------------+---------------------------------------------------+
             getUTCDay()       Returns the day of the week converted to universal 
                               time. This method was added in JavaScript 1.2.
+-----------+----------------+---------------------------------------------------+
             getUTCFullYear()  Returns a four-digit representation of the year 
                               converted to universal time. This method was added 
                               in JavaScript 1.2.
+-----------+----------------+---------------------------------------------------+
             getUTCHours()     Returns the hour converted to universal time. This 
                               method was added in JavaScript 1.2.
+-----------+----------------+---------------------------------------------------+
           getUTCMilliseconds()Returns the milliseconds converted to universal time. 
                               This method was added in JavaScript 1.2.
+-----------+----------------+---------------------------------------------------+
             getUTCMinutes()   Returns the minutes converted to universal time. 
                               This method was added in JavaScript 1.2.
+-----------+----------------+---------------------------------------------------+
              getUTCMonth()    Returns the month converted to universal time. This 
                               method was added in JavaScript 1.2.
+-----------+----------------+---------------------------------------------------+
             getUTCSeconds()   Returns the seconds converted to universal time. 
                               This method was added in JavaScript 1.2.
+-----------+----------------+---------------------------------------------------+
              getYear()        Returns number of years since 1900.
+-----------+----------------+---------------------------------------------------+
              parse()          Converts the passed-in string date to milliseconds.
+-----------+----------------+---------------------------------------------------+
              setDate()        Sets the date within the month (1 to 31).
+-----------+----------------+---------------------------------------------------+
             setFullYear()     Sets the year as a four-digit number. This method 
                               was added in JavaScript 1.2.
+-----------+----------------+---------------------------------------------------+
             setHours()        Sets hour within day (0 to 23).
+-----------+----------------+---------------------------------------------------+
            setMilliseconds()  Sets the milliseconds. This method was added in 
                               JavaScript 1.2.
+-----------+----------------+---------------------------------------------------+
              setMinutes()     Sets the minutes within the hour (0 to 59).
+-----------+----------------+---------------------------------------------------+    
              setMonth()       Sets the month within the year (0 to 11).
+-----------+----------------+---------------------------------------------------+
              setSeconds()     Sets the seconds within the minute (0 to 59).
+-----------+----------------+---------------------------------------------------+
              setTime()        Sets the number of milliseconds since 1/1/70 00:00:00.
+-----------+----------------+---------------------------------------------------+
              setUTCdate()     Sets the day of the month in universal time. 
                               This method was added in JavaScript 1.2.
+-----------+----------------+---------------------------------------------------+
            setUTCFullYear()   Sets the year as a four-digit number in universal 
                               time. This method was added in JavaScript 1.2.
+-----------+----------------+---------------------------------------------------+
             setUTCHours()     Sets the hour in universal time. This method was 
                               added in JavaScript 1.2.
+-----------+----------------+---------------------------------------------------+
         setUTCMilliseconds()  Sets the milliseconds in universal time. This method 
                               was added in JavaScript 1.2.
+-----------+----------------+---------------------------------------------------+
             setUTCMinutes()   Sets the minutes in universal time. This method was 
                               added in JavaScript 1.2.
+-----------+----------------+---------------------------------------------------+
              setUTCMonth()    Sets the month in universal time. This method was 
                               added in JavaScript 1.2.
+-----------+----------------+---------------------------------------------------+
             setUTCSeconds()   Sets the seconds in universal time. This method was 
                               added in JavaScript 1.2.
+-----------+----------------+---------------------------------------------------+
             setYear()         Sets the number of years since 1900.
+-----------+----------------+---------------------------------------------------+
              toGMTString()    Returns the date string in universal format.
+-----------+----------------+---------------------------------------------------+    
            toLocalString()    Returns the date string in the local system's format.
+-----------+----------------+---------------------------------------------------+
             toSource()        Returns the source of the Date object. This method 
                               was added in JavaScript 1.3.
+-----------+----------------+---------------------------------------------------+    
             toString()        Returns the date and time as a string in local time.
+-----------+----------------+---------------------------------------------------+
             toUTCString()     Returns the data and time as a string in universal 
                               time (UTC). This method was added in JavaScript 1.2.
+-----------+----------------+---------------------------------------------------+
             UTC()             Convertscomma-delimited values to milliseconds of 
                               UTC date.
+-----------+----------------+---------------------------------------------------+
             valueOf()         Returns the equivalence of the Date object in 
                               milliseconds. This method was added in JavaScript 1.1.
+-----------+----------------+---------------------------------------------------+
 Property
+-----------+----------------+---------------------------------------------------+
             prototype         Property that allows you to add methods and 
                               properties to the Date object. This property was 
                               added in JavaScript 1.1.
+-----------+----------------+---------------------------------------------------+
*/
Related examples in the same category
1.  Demo all methods in Date class
2.  how many days Between two dates
3.  Today's Date
4.  Display date: day month year in string
5.  Date: date, month, and year.
6.  Set date: setDate, setHour
7.  UTC time: getUTCDate returns the Universal Coordinated Time
8.  Display weekday: name of the current day
9.  Display full date : complete date with the day name and month name
10.  Display time: continues writing time per second.
11.  Date: Week of the year
12.  Display current date: year, month day in number
13.  Extending the Date Object to Include Some New Methods
14.  Using the Date Object
15.  Output day
16.  A Dynamic Welcome Message
17.  How Many Days Until Christmas
18.  Summer Games Countdown
19.  Simple Date Validation
20.  GMT Calculator
21.  Days Before Next Christmas Xmas
22.  Get how many days before a date








Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.