DATE$ function

Purpose:

DATE$ returns a date formatted MM-DD-YYYY, where MM represents two digits of the month, including a leading 0 if needed, DD represents two digits of the day, and YYYY represents the four digits of the Gregorian calendar year. This format has been chosen for use in BCX to match the DATE$ format used in GW-Basic, QuickBasic, Turbo/PowerBasic, VBDOS->VB6, FreeBasic and others.

Syntax 1:

RetStr = DATE$

Return Value:

  • Data type: STRING
    RetStr The system date formatted MM-DD-YYYY, where MM represents two digits of the month, DD represents two digits of the day, and YYYY represents the four digits of the year.

Parameters:

  • None.

Syntax 2:

RetStr = DATE$(IntParam AS INTEGER)

Return Value:

  • Data type: STRING
    RetStr Depending on the value of the IntParam parameter, either the system date or the current Coordinated Universal date formatted MM-DD-YYYY, where MM represents two digits of the month, DD represents two digits of the day, and YYYY represents the four digits of the year.

Parameters:

  • Data type: INTEGER
    IntParam A zero value indicates that the return should be a character string containing the system date formatted MM-DD-YYYY, where MM represents two digits of the month, DD represents two digits of the day, and YYYY represents the four digits of the year. A non-zero value indicates that the return should be a character string containing the current Coordinated Universal date formatted MM-DD-YYYY, where MM represents two digits of the month, DD represents two digits of the day, and YYYY represents the four digits of the year.

Example 1:

PRINT "The system date is ", DATE$

Example 2:

DIM TheDate%

TheDate% = 0 
PRINT "The system date is ", DATE$(TheDate%)
TheDate% = 1
PRINT "The Coordinated Universal date is ", DATE$(TheDate%)

BCX Console Sample Programs using DATE$ function.


ISODATE$ function

Purpose:

ISODATE$ returns a date formatted as YYYY-MM-DD, where YYYY is the year, MM are two digits representing the month and DD are two digits representing the day.

Syntax 1:

RetStr = ISODATE$

Return Value:

  • Data type: STRING
    RetStr The system date formatted as YYYY-MM-DD, where YYYY is the year, MM are two digits representing the month and DD are two digits representing the day.

Parameters:

  • None.

Syntax 2:

RetStr = ISODATE$(IntParam AS INTEGER)

Return Value:

  • Data type: STRING
    RetStr Depending on the value of the IntParam parameter, either the system date or the current Coordinated Universal date formatted as YYYY-MM-DD, where YYYY is the year, MM are two digits representing the month and DD are two digits representing the day.

Parameters:

  • Data type: INTEGER
    IntParam A zero value indicates that the return should be a character string containing the system date formatted as YYYY-MM-DD, where YYYY is the year, MM are two digits representing the month and DD are two digits representing the day. A non-zero value indicates that the return should be a character string containing the current Coordinated Universal date formatted as YYYY-MM-DD, where YYYY is the year, MM are two digits representing the month and DD are two digits representing the day.

Example 1:

PRINT "The system date is ", ISODATE$

Example 2:

DIM TheDate%

TheDate% = 0 
PRINT "The system date is ", ISODATE$(TheDate%)
TheDate% = 1
PRINT "The Coordinated Universal date is ", ISODATE$(TheDate%)