Page tree
Skip to end of metadata
Go to start of metadata

The pjs.timestamp() API converts an expression to a timestamp, or returns the current date & time as a timestamp if no parameters are passed to it. 

Parameters


  • Field or expression (optional)
  • Format or Fractional seconds (optional) - format can be *iso or *iso0
  • Fractional seconds (optional)

Return Value


A timestamp value

RPG Equivalent


%TIMESTAMP()

What's the difference between *iso and *iso0?

*iso is the default timestamp format. *iso0 is for indicating there are no separators in the timestamp.

Examples


pjs.define("Kstamp", { type: 'timestamp', initValue: pjs.timestamp('2019-12-31-12.34.56.789000') });
timest = pjs.timestamp('1960-09-29-12.34.56.12300', "*iso");
data = pjs.char(timest);