www.krengeltech.com

RXS_timestampToChar

From Wiki

User Guide

Contents

Description

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.

Prototype

     D RXS_timestampToChar...
     D                 pr            50a   varying
     D  pFormat                      30a   value
     D  pTimestamp                     z   value

Parameters

pFormat
Specify the format of the timestamp string so the converter knows where to place each portion of the timestamp. The idea is to combine the below keywords (i.e. yyyy, MM, dd, hh, mm, ss, SSSSSS) into a string that represents the location of where the corresponding value should be placed in the string representation of the timestamp.
  • yyyy = Year
  • MM = Month
  • dd = Day
  • hh = Hour
  • mm = Minute
  • ss = Second
  • SS = Millisecond
pTimestamp
Specify the timestamp to be converted.

Return value

None.

Notes / Examples

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