• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 13. Dealing with Dates and Times... > Other Date Object Methods

Other Date Object Methods

To close your look at the Date object, this section presents a very brief look at all the other methods that are available for this object. The complete list is in Table 13.4.

Table 13.4. More Date Object Methods
Method SyntaxJavaScript VersionDescription
Date_Object.getTimezoneOffset()1.0Returns the number of minutes difference between the user's local time zone and GMT.
Date_Object.getUTCFullYear()1.2Returns the UTC year as a four-digit number (1999, 2000, etc.)
Date_Object.getUTCYear()1.2Returns the UTC year as a two- or four-digit number
Date_Object.getUTCMonth()1.2Returns the UTC month of the year; from 0 (January) to 11 (December)
Date_Object.getUTCDate()1.2Returns the UTC date in the month; from 1 to 31
Date_Object.getUTCDay()1.2Returns the UTC day of the week; from 0 (Sunday) to 6 (Saturday)
Date_Object.getUTCHours()1.2Returns the UTC hour of the day; from 0 (midnight) to 23 (11:00 PM)
Date_Object.getUTCMinutes()1.2Returns the UTC minute of the hour; from 0 to 59
Date_Object.getUTCSeconds()1.2Returns the UTC second of the minute; from 0 to 59
Date_Object.getUTCMilliseconds()1.2Returns the UTC milliseconds of the second; from 0 to 999
Date_Object.getUTCTime()1.2Returns the milliseconds since January 1, 1970 GMT
Date.parse (string)1.0Returns a Date object corresponding to the date representation given by string.
Date_Object.setUTCFullYear (yyyy)1.2Sets the year as a four-digit number (1999, 2000, etc.)
Date_Object.setUTCYear (yy)1.2Sets the year as a two- or four-digit number
Date_Object.setUTCMonth (mth)1.2Sets the month of the year; from 0 (January) to 11 (December)
Date_Object.setUTCDate (dd)1.2Sets the date in the month; from 1 to 31
Date_Object.setUTCHours (hh)1.2Sets the hour of the day; from 0 (midnight) to 23 (11:00 PM)
Date_Object.setUTCMinutes (mm)1.2Sets the minute of the hour; from 0 to 59
Date_Object.setUTCSeconds (ss)1.2Sets the second of the minute; from 0 to 59
Date_Object.setUTCMilliseconds (ms)1.2Sets the milliseconds of the second; from 0 to 999
Date_Object.setUTCTime (ms)1.2Sets the milliseconds since January 1, 1970 GMT
Date_Object.toGMTString()1.0Converts the Date object to a string that displays the date and time in GMT format
Date_Object.toLocaleString()1.0Converts the Date object to a string that displays the date using the settings specified on the user's computer
Date_Object.toString()1.0Converts the Date object to a string that displays the date and time in the user's local time zone
Date_Object.toUTCString()1.2Converts the Date object to a string that displays the date and time in GMT format (same as toGMTString())
Date.UTC (yyyy,mth,dd,hh,mm,ss,ms)1.0Converts a date specification into the number of milliseconds from January 1, 1970 to the specified date
Date_Object.valueOf()1.1Converts the date into milliseconds (same as getTime())



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint