DATETIMEVALUE

Concept Link IconSee also

Return the number of milliseconds since the first of January 1970 at 00:00:00.000.

WebVue support - Yes.

Although this instruction returns the number of milliseconds since 1970, it will not work with dates earlier than 01/01/1980.

Condition

Syntax

Current time 1
Date and time as comma separated parameters 2
Date and time as formatted strings 3

Syntax 1

DblVal = DATETIMEVALUE();

Return type: DOUBLE.

Execution

Return the number of milliseconds at the time the function is executed. If executed in a WebVue session context this instruction is processed by the computer that hosts the web back end and the current date and time from the web back end is used.

Syntax 2

DblVal = DATETIMEVALUE(Day, Month, Year, Hour, Minute, Second[, Millisecond]);

Return type: DOUBLE.

Argument

Meaning

Day

Day of the month (1 to 31). Type INTEGER.

Month

Month number (1 to 12). Type INTEGER.

Year

Year (1980 to 2106). Type INTEGER.

Hour

Hour (0 to 23). Type INTEGER.

Minute

Minutes (0 to 59) Type INTEGER.

Second

Seconds (0 to 59). Type INTEGER.

Millisecond

Milliseconds (0 to 999). If not specified then the default of 0 is used. Type INTEGER.

Execution

Return the number of milliseconds for the specified date and time.

Syntax 3

DblVal = DATETIMEVALUE(DD/MM/YY, HH:MM:SS[:Msc]);

Return type: DOUBLE.

Argument

Meaning

DD/MM/YY

The date in DD/MM/YY or DD/MM/YYYY format. For example,, 01/01/94 or 28/04/1984. Type STR.

HH:MM:SS

 

The time in HH:MM:SS or HH:MM:SS:Msc format. For example, 22:30:00 or 10:30:05:500. Type STR.

Execution

Return the number of milliseconds for the specified date and time.

Example

SUB Main()

'Declare variables

DIM dbldatetime as double;

DIM dbldatetime2 as double;

DIM dbldatetime3 as double;

 

dbldatetime = DATETIMEVALUE();

'Retrieve the current date & time

PRINT(dbldatetime);

dbldatetime2 = DATETIMEVALUE(4, 6, 2002, 22, 12, 12 , 654);

PRINT(dbldatetime2);

dbldatetime3 = DATETIMEVALUE("04/06/2002", "22:12:12:654");

PRINT(dbldatetime3);

END SUB