DT_CURRENT_DATETIME: Returning the Current Date and Time

How to:

DT_CURRENT_DATETIME returns the current date and time provided by the running operating environment in date-time format, with a specified time precision.

Syntax: How to Return the Current Date and Time

DT_CURRENT_DATETIME(component)

where:

component

Is one of the following time precisions.

  • SECOND.
  • MILLISECOND.
  • MICROSECOND.

Note: The field to which the value is returned must have a format that supports the time precision requested.

Example: Returning the Current Date and Time

DT_CURRENT_DATETIME returns the current date and time to microsecond precision.

DT_CURRENT_DATETIME(MICROSECOND)

For September 8,2106 at 5:10:31.605718 p.m. (returned to a field with format HYYMDm), the result is 2016/09/08 17:10:31.605718.

WebFOCUS

Feedback