Chapter 3 DynaScript Predefined Objects


Date object

Object

Enables the storage and retrieval of dates and times. The Date object has no properties.

Standard: ECMAScript

Syntax

To use a Date's method:

Date.MethodName( parameter ) 

Description

The Date object may be constructed in any of these ways:

MyDateObj = new Date( )

MyDateObj = new Date( dateVal )

MyDateObj = new Date( [year, month [, date [, hours [, minutes [, seconds [, ms]]]]]] )

The following syntax creates an integer holding the number of milliseconds from midnight, January 1, 1970.

myInt = DateUTC( [year, [month [, date [, hours [, minutes [, seconds [, ms]]]]]]] )

The parameters are:

The Date object has both a built-in object as well as constructors that allow users to create instances of a Date object. When referring to Date in the syntax sections of this chapter, we are referring to an instance of the Date object, not the built-in Date object.

If a value for the date object goes beyond its boundaries, the other values will be modified accordingly. For example if 14 is the given value for the month parameter, the month value will be equal to March.

Example

See also

"valueOf method"

 


Copyright © 1999 Sybase, Inc. All rights reserved.