Skip to content

SysDate

Obsolete

This command is replaced by the CurrentDateTime function.

See Also: Time and Date Functions, Sleep

Purpose

To return the current system date, hour, minute, and second.

Syntax

SysDate {dtDate} [{iHour} [{iMinute} [{iSecond}]]]

where:

  • {dtDate}: contains the current system date.
  • {iHour}: contains the current system hour.
  • {iMinute}: is allowed only if {iHour} is used.
  • {iSecond}: is allowed only if {iMinute} is used.

What It Does

SysDate retrieves the date and time from the operating system and moves the date to dtDate. If an additional variable is provided, the hour is moved to that variable (iHour). If two additional variables are provided, the minute is moved to the second additional variable (iMinute). If three additional variables are provided, the second is moved to the third additional variable (iSecond).

It can be called using a Date, DateTime, or String variable or table.column.

SysDate moves the date to date as a Julian integer, which can be interpreted correctly by date variables. The hour is moved to the hours in 24-hour format.

Example

DateTime dtToday
Integer iHr iMin iSec
SysDate dtToday iHr iMin iSec

In this example, if it is 1:36:18 PM on January 1, 2014, DataFlex moves 01/01/2015 to dtToday, 13 to iHr, 36 to iMin, and 18 to iSec.

Notes

  • If SysDate is used with a Date variable or table.column, only the date will be returned, since Date types do not have a time component; use DateTime to store both date and time.
  • This command returns the system date with the year in two digits if the date attributes SysDate4_State and Date4_State are both set to False. See Set_Date_Attribute for details.
  • The SysDate4_State and Date4_State date attributes are defaulted to True in DataFlex applications. You can change the value of these attributes using the Set_Date_Attribute command.
  • The predefined variable Strlen is set to the value of hour and the predefined variable strmark is set to the value of minute.