Gen 8.6 Java applications function CURRENT_TIMESTAMP precision
search cancel

Gen 8.6 Java applications function CURRENT_TIMESTAMP precision

book

Article ID: 27376

calendar_today

Updated On:

Products

Gen Gen - Workstation Toolset

Issue/Introduction

Does the function CURRENT_TIMESTAMP in Gen 8.6 Java applications support millisecond or microsecond precision?

Resolution

For Java, the CURRENT_TIMESTAMP function (implemented as TIRDAT2) previously only retrieved milliseconds (10-3 of a second), because it was implemented with a Calendar object.
That implementation was changed to a LocalDateTime object by a 2022 security maintenance update PTF RTJ86301 (replaced later by RTJ863011) which is also in the latest Gen 8.6.4 Consolidation PTF WKS86400.
That change provided microsecond support per this Gen EDGE Community idea: (Gen-Java) does Not support microsecond (10 -6 of a second).

However when the application is running under different JRE/JVM versions different results will be seen due the variation in how each Java version implements the default System Clock (Clock.systemDefaultZone()):

Additional Information

NOTE:
If a Java timestamp attribute view is assigned a value which has microseconds already populated, that precision will be maintained e.g. if a timestamp value with microsecond precision is read from a RDBMS and is assigned to a Java timestamp attribute view, then microseconds will be maintained in the view.

Gen 8.6 Documentation references:
Top level page: Gen™ 8.6
See sections:
"Developing > Designing > Using the Toolset > Current Data Store Properties Dialog > Current Timestamp"
"Developing > Designing > Using the Toolset > Domain"