CitectVBA Programming Reference > CitectVBA Function Reference > Date and Time Functions > Time

Time

Gets the current time in string format.

Time/date functions can only be used with dates from 1980 to 2035. You should check that the date you are using is valid with Cicode similar to the following:

IF StrToDate(Arg1) > 0 THEN
...
ELSE
...
END

Syntax

Time([Format])

Format:

The format of the time:

0 - Short time format, hh:mm

1 - Long time format., hh:mm:ss

If omitted, the default Formatis 0.

Return Value

The current time (as a string).

Related Functions

Date

Example

! If the current time is 10:45:30;
Variable=Time();
! Sets Variable to "10:45".
Variable=Time(0);
! Sets Variable to "10:45".
Variable=Time(1);
! Sets Variable to "10:45:30".

See Also

Time/Date Functions