DATETODATETIME ER function

The DATETODATETIME function returns a DateTime value that is converted from a given date value to a date/time value in Coordinated Universal Time (Greenwich Mean Time [GMT]).

Syntax

DATETODATETIME (date)

Arguments

date: Date

A date value that represents the date to convert.

Return values

DateTime

The resulting date/time value.

Example 1

DATETODATETIME (CompInfo. 'getCurrentDate()') returns the date of the current Microsoft Dynamics 365 Finance session, December 24, 2015, as 12/24/2015 12:00:00 AM. In this example, CompInfo is an Electronic reporting (ER) data source of the finance and operations/Table type, and it refers to the CompanyInfo table.

Example 2

DATETODATETIME (DATEVALUE ("2019-11-12T16:00:00.0000000-07:00", "O")) returns the date/time value 11/12/2019 12:00:00 AM.

Additional resources

Date and time functions