Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.

For information on migrating to InterSystems IRIS, see Why Migrate to InterSystems IRIS?

Current Date and Time

Obtain the current date and time.

Background Information

Each language provides system variables or functions that provide the current system time. See Caché ObjectScript Reference, Caché MultiValue Basic Reference, Caché Basic Reference, and Caché SQL Reference.

In many Caché applications, dates and times are stored and transmitted in a format called $H format or $HOROLOG format. For an introduction, see “Date and Time Values” in the Caché Programming Orientation Guide.

Available Tools

In addition, InterSystems provides the following tools:

Includes the following class methods that return current date/time values:

  • Horolog()

  • TimeStamp()

Availability: All namespaces.

Includes the following class methods that return current date/time values:

  • Date()

  • DateTime()

  • Time()

Availability: All namespaces.

Includes the following class methods that return current date/time values:

  • NowLocal()

  • NowUTC()

Availability: All namespaces.

Reminder

The special variable $SYSTEM is bound to the %SYSTEM package. This means that (for ObjectScript) instead of ##class(%SYSTEM.class).method(), you can use $SYSTEM.class.method().

See Also

Feedback