Previous Document Next Document

Object Model Reference : Classes : C : CorelScriptTools : Methods : CorelScriptTools.GetDateInfo


CorelScriptTools.GetDateInfo

Sub GetDateInfo(Date As Date, Year As Long, Month As Long, Day As Long, DayOfWeek As Long)

Description

Member of CorelScriptTools

The GetDateInfo method extracts the components of a date expression to numeric variables.

Parameter
Description
DateExp
Specifies the date expression to extract components from
Year
Specifies the numeric variable that is assigned the year component from the specified date expression
Month
Specifies the numeric variable that is assigned the month component from the specified date expression
Day
Specifies the numeric variable that is assigned the day component from the specified date expression
DayOfWeek
Specifies the numeric variable that is assigned the day of week component from the specified date expression. Sunday corresponds to 1, Monday to 2, and so on.

 
The GetDateInfo method can accept only a date value between January 1, 1980 (date serial number 29221) and December 31, 2099 (date serial number 73050). If a date outside this range is specified, an error occurs.
Example

In the following code example, the first line declares the date variable TodayDate. This variable is then assigned the current date with the GetCurrDate function. The variables Y, M, D, and DW are then assigned their respective component of the date stored in TodayDate. If TodayDate is set to March 12, 2005, then Y equals 2005, M equals 3, D equals 12, and DW equals 7.

DIM TodayDate AS DATE
TodayDate = GETCURRDATE()
GETDATEINFO TodayDate, Y&, M&, D&, DW&

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.