CurrentDateTime

See Also: Time and Date Functions

Purpose

The CurrentDateTime function returns a DateTime or Time variable that contains the current local time.

Return Type

DateTime, Time or Date

Syntax

CurrentDateTime()

What It Does

The CurrentDateTime function returns a DateTime variable or Time variable that contains the current local time. This functions respects the current Windows regional settings configuration for the date and time format.

Example

This sample moves the current date and time to a DateTime variable.

Procedure TestCurrentDateTime

    DateTime dtCurrentDateTime

 

    Move (CurrentDateTime()) to dtCurrentDateTime

    Showln "The time is " dtCurrentDateTime

End_Procedure

Example

This sample moves the current time to a Time variable.

Time tiNow

Move (CurrentDateTime ()) to tiNow

Example

This sample moves the current date to a Date variable.

Date dNow

Move (CurrentDateTime ()) to dNow