DATETIME function

Synopsis
This function returns a string representing a date and time.
Remarks
Variations
DATETIME()
Returns the current date and time.
Parameters
Returns
Returned types: String.
Examples
1.

The following example returns the current time in the default format. For example, "05/28/1977 16:41:01".

DATETIME()
DATETIME(Format)
Returns the current date and time in the specified format.
Parameters
Format

Specifies the format to use when returning the date and time.

Supported types: String.
Returns
Returned types: String.
Examples
1.

The following example returns the current time in the specified format. For example, the following format includes milliseconds: "5/28/1977 16:43:46.258".

DATETIME("M/d/yyyy H:mm:ss.fff")

The following format has the day, month, and year separated by hyphens: "05-28-1977 16:43:46.258".

DATETIME("MM-d-yyyy H:mm:ss.fff")

The following format has the day, month, year and time, all separated by underscores: "1977_05_28_16_43_46_25".

DATETIME("yyyy_M_d_H_mm_ss_ff")

The following format has the day, month, year with no separation: "28051977".

DATETIME("ddMMyyyy")
DATETIME(DateTime)
Returns the date and time of the specified TimeStamp object.
Parameters
DateTime

Specifies the TimeStamp object to use to return its date and time.

Supported types: Object.
Returns
Returned types: String.
Examples
1.

The following example returns the time associated with the specified TimeStamp object, in the same default format as DATETIME(). For example, "5/28/1977 16:41:01".

DATETIME(TimeStamp.Time)
DATETIME(DateTime, Format)
Returns the date and time of the specified TimeStamp object in the specified format.
Parameters
DateTime

Specifies the TimeStamp object to use to return its date and time.

Supported types: Object.
Format

Specifies the format to use when returning the date and time.

Supported types: String.
Returns
Returned types: String.
Examples
1.

The following example returns the time associated with the specified TimeStamp object. For example, "May/28/77 16:46:42.134"

DATETIME(Camera.GrabTime, "MMM/dd/yy H:mm:ss.fff")

The following example returns the time associated with the specified TimeStamp object. For example, "1977_05_28_16_43_46_25".

DATETIME(Camera.GrabTime, "yyyy_M_d_H_mm_ss_ff")

The following example returns the time associated with the specified TimeStamp object. For example, "28051977".

DATETIME(Camera.GrabTime, "ddMMyyyy")