Home » Fusion Middleware & Colab Suite » Business Intelligence » XML Publisher date formatting
XML Publisher date formatting [message #303888] |
Mon, 03 March 2008 02:35 |
daibatzu
Messages: 36 Registered: September 2007
|
Member |
|
|
Hello, I have a problem formatting dates in XML Publisher. The date I want to display is a parameter. When it is submitted it is of the format:
P_FROM_DATE='2008/12/01 00:00:00'
P_TO_DATE='2008/12/01 00:00:00'
While displaying the date, I am using
<?format-date:$P_FROM_DATE;'MEDIUM'?>
But the date which is being displayed is still showing up as
'2008/12/01 00:00:00'
How can I change the date format for this? Many thanks
|
|
|
Re: XML Publisher date formatting [message #303970 is a reply to message #303888] |
Mon, 03 March 2008 09:10 |
daibatzu
Messages: 36 Registered: September 2007
|
Member |
|
|
Yay, I've found a solution.
Basically, dates can only be formatted in XML Publisher if they are of the format YYYY-MM-DD, so something like 2008-11-01 can be formatted. Since my parameter was returning a date like '2008/12/01 00:00:00', this is what I did.
<?xdofx:substr($P_FROM_DATE,1,4) || '-' || substr($P_FROM_DATE, 6,2) || '-' || substr($P_FROM_DATE, 9,2)?>
So basically, in the help text for my text form field, I am getting substrings of the year, month and date and combining them to the format YYYY-MM-DD.
After this is completed, I now select the type for this text form field to be a Date, and my date format is dd-MMM-yy.
Works like a charm.
Thanks to anyone who tried to figure this out.
|
|
|
|
|
Re: XML Publisher date formatting [message #601663 is a reply to message #314498] |
Sat, 23 November 2013 21:29 |
|
purnimagn
Messages: 2 Registered: November 2013 Location: Bangalore
|
Junior Member |
|
|
Hi,
I am trying to use the same logic you mentioned, but with the Instr withing the substring. My date format is d/m/yyyy.
The code I have written is
<?xdofx:substr(SsCalculatedArrivalDate,Instr(SsCalculatedArrivalDate,'/',1,2)+1,Instr(SsCalculatedArrivalDate,'/',1,2)+4) || '-' || substr(SsCalculatedArrivalDate,Instr(SsCalculatedArrivalDate,'/',1,1)+1,Instr(SsCalculatedArrivalDate,'/',(Instr(SsCalculatedArrivalD ate,'/',1,1)+1),2)- (Instr(SsCalculatedArrivalDate,'/',1,1))) || '-' || substr(SsCalculatedArrivalDate,1,Instr(SsCalculatedArrivalDate,'/',1,1)-1)?>
which returns me the date in the yyyy-m-d format, but I cant use the word properties to display it in dddd, MMMM dd, yyyy, but it always displays in yyyy-m-d.
Please help.
Thanks,
Purnima
|
|
|
|
Goto Forum:
Current Time: Sun Feb 02 22:14:07 CST 2025
|