Use RXS_timestampToChar() to easily convert a timestamp coming from your database or program to an XML format that matches the requirements in the XSD (XML Schema Definition). This will save the headache of programming for all of the different timestamp formats out there and doing a bunch of sub-stringing and concatenation.

Valid keywords for pFormat are listed below:

  • yyyy = Year
  • MM = Month
  • dd = Day
  • hh = Hour
  • mm = Minute
  • ss = Second
  • SS = Millisecond

Typical usage would look like:

myStr = RXS_timestampToChar('yyyy-MM-ddThh.mm.ss': %Timestamp());

Subprocedure Prototype

D RXS_timestampToChar...
D                 pr            50a   varying

Converts a timestamp field into a character value.

D  pFormat                      30a   value


The timestamp format in which to return the character data.

D  pTimestamp                     z   value


The timestamp to be converted.