JavaScript method: XMLDate.JSDate()

This method returns a JavaScript date/time object. This method is an alias of the getDate() method.

Syntax

XMLDate.JSDate();

Arguments

There are no arguments for this method.

Return values

A string or null.

The method returns a JavaScript date/time object or null if the conversion fails.

Example

This example does the following:

  • Creates a new XMLDate object containing today's date
  • Converts the XMLDate object to a JavaScript date/time object then displays the result
print( "Creating XMLDate object..." );
var d = new XMLDate( new Date() );
print( "The value of the new XMLDate object is: " + d );
print( "Converting the XMLDate to a JavaScript object..." );
var js = d.JSDate();
print( "The JavaScript date/time object is: " + js );