Date Formats in OIC Mapper

Use the below for formatting the date in OIC mapper


<xsl:value-of select="xp20:format-dateTime(fn:current-dateTime(),'[Y0001]-[M01]-[D01]')"/>


Output:

2022-09-09


Use the below for formatting the date and incrementing it by 30 days in OIC mapper


<xsl:variable name="curdate" select="translate(string(fn:current-date () +xsd:dayTimeDuration('P30D') ),'Z','')"/>
<ns37:RequestedDeliveryDate>
   <xsl:value-of select="concat(substring($curdate,1,4),'/',substring($curdate,6,2),'/',substring($curdate,9,2))"/>
</ns37:RequestedDeliveryDate>
 
 
concat (xp20:format-dateTime (fn:current-dateTime(), "[D01]-[M01]-[Y0001]" ), " ", xp20:format-dateTime (fn:current-dateTime(), "[H01]:[m01]:[s01].[f001]" ))
 

concat( substring-before(string(fn:current-dateTime()),"T")," ", substring-before(substring-after(string(fn:current-dateTime()),"T"),"."))


In case you want to add Date with time zone to some field use the below

fn:adjust-dateTime-to-timezone (fn:current-dateTime(), xsd:dayTimeDuration ("PT0H" ) )

This can be used to add mapping to column defined in below format in any database table:

CREATION_DATE	TIMESTAMP(6) WITH TIME ZONE

Comments