Limited support BMC provides limited support for this version of the product. As a result, BMC no longer accepts comments in this space. If you encounter problems with the product version or the space, contact BMC Support.BMC recommends upgrading to the latest version of the product. To see documentation for that version, see BMC AMI Command Center for Db2 13.2

TIMESTAMP function


The TIMESTAMP function returns a TIMESTAMP WITHOUT TIME ZONE value from its argument or arguments.

TIMESTAMP.png

The rules for the arguments depend on whether you specify the second argument.

If only one argument is specified without a precision of n

The argument must be an expression that returns a value of one of the following built-in data types:

  • DATE
  • TIMESTAMP
  • Character string representation of timestamp

Important

A time zone in a string representation of a timestamp results in an invalid format.

A character string with an actual length of 8 is assumed to be a TOD clock value.

A character string with an actual length of 14 represents a valid date and time in the form yyyyxxddhhmmss, where yyyy is the year, xx is the month, dd is the day, hh is the hour, mm is the minute, and ss is the seconds.

The resulting timestamp has a precision of 6.

If only one argument is specified with a precision of n

The argument must be an expression that returns a value of one of the following built-in data types:

  • Date
  • Timestamp
  • Character string representation of timestamp

The resulting timestamp has a precision of n, where n is between 0 and 12 inclusive.

Important

A time zone in a string representation of a timestamp results in an invalid format.

If both arguments are specified

The first argument must be an expression that returns a value of one of the following built-in data types:

  • Date
  • Timestamp
  • Character string representation of timestamp

The second argument must be an expression that returns a value of one of the following built-in data types:

  • Time
  • Character string representation of time

Important

If any of the arguments can be null, the result can be null; if any argument's value is null, the result is the null value.





 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*