Back to Aurora Vision Library Lite website

You are here: Start » System » OPC UA » OPCUA_FormatDateTime

OPCUA_FormatDateTime


Header: STD.h
Namespace: avl

Converts the OPC UA DateTime timestamp value to a readable formats

Syntax

void avl::OPCUA_FormatDateTime
(
	atl::int64 inTimestamp,
	const atl::String& inFormat,
	atl::String& outDateTimeString,
	avl::DateTime& outDateTime
)

Parameters

Name Type Range Default Description
Input value inTimestamp int64 0 - 2650467743999999999 OPC UA DateTime timestamp value
Input value inFormat const String& \"%x %X\" Date time format string
Output value outDateTimeString String& Date time in textual format
Output value outDateTime DateTime& Date time details structure

Description

The OPC UA DateTime or UtcTime timestamp data types are representing the date and time point as a 64bit number of 100 nanosecond intervals since January 1, 1601. In the vision application those data types are represented by the internal Long type.

This filter allows to convert this timestamp counter into a more usable formats for purpose of handling or display, by taking the OPC UA DateTime value on the inTimestamp input and converting it to a DateTime structure on the outDateTime output and formatting a textual (display) representation on the outDateTimeString output.

The value on the inTimestamp input must not be negative.

The inFormat input specifies the format of the textual representation of the date and time to create on the outDateTimeString output. See the CurrentDateTime filter documentation for information about the syntax of the formatting string.

Please note that this filter does not have access to the timezone of the processed date and time. In particular, this filter does not know whether the source timestamp is in UTC or in the current (server) timezone, and it needs to be taken under consideration separately when working with the output of this filter.

Errors

List of possible exceptions:

Error type Description
DomainError Timestamp year is out of valid range for formatting in OPCUA_FormatDateTime.