API Documentation > CorelDRAW > 2025-v26 > CorelScriptTools > ICorelScriptTools
CorelScriptTools.GetDateInfo method
Gets Date Info
Syntax:
Sub GetDateInfo(ByVal Date As Date, ByRef Year As Long, ByRef Month As Long, ByRef Day As Long, ByRef DayOfWeek As Long)
Parameters:
Name Type Description
Date
Date
Year
Long
Month
Long
Day
Long
DayOfWeek
Long
Remarks:
The GetDateInfo method extracts the components of a date expression to numeric variables. 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.
Examples:
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&