Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

transform date from dd-mon-yy to yyyy-mm-dd

703742Sep 29 2011 — edited Jun 29 2012
Hi
I have a simple date transformation question.
my input date format is DD-MON-YY, I want this converted to YYYY-MM-DD
I did look into the xp20:format-dateTime and ora:formatDate but did not find a way
to control the input format. I did test the transformation below, and this one gives the expected output, as
long as the input is xp20:current-dateTime().
<xsl:value-of select="xp20:format-dateTime(xp20:current-dateTime(),'[Y0001]-[M01]-[D01]')"/>

How do I switch the date format to handle DD-MON-YY as input.

To be specific:
when ns:myDate=01-Aug-08' I would expect outcome as below,
<xsl:value-of select="xp20:format-dateTime(ns:myDate,'[Y0001]-[M01]-[D01]')"/> => 2008-08-01
but this is clearly not so.

any idea on how to do this, without starting a full substring-implementation?

according to this thread, it looks like we need to leave this to java, but I believe it must be possible to
handle this within xslt-transformation.
On the other hand, dd-mon-yy is not ISO, and four digit year would be unambiguous .

anyway:
9415068
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 27 2012
Added on Sep 29 2011
3 comments
3,207 views