Home » Fusion Middleware & Colab Suite » Business Intelligence » XML Publisher date formatting
XML Publisher date formatting [message #303888] Mon, 03 March 2008 02:35 Go to next message
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 Go to previous messageGo to next message
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 #314467 is a reply to message #303888] Wed, 16 April 2008 16:19 Go to previous messageGo to next message
rao_raghunath
Messages: 1
Registered: April 2008
Junior Member
Thanks for the informaiton Daibatzu. I had the same problem and was able to resolve the same way as you did.
Re: XML Publisher date formatting [message #314498 is a reply to message #314467] Wed, 16 April 2008 23:13 Go to previous messageGo to next message
cvs_1984
Messages: 136
Registered: August 2007
Location: Punjab, INDIA
Senior Member

Thank you i also have the same problem it is useful to me.
Re: XML Publisher date formatting [message #601663 is a reply to message #314498] Sat, 23 November 2013 21:29 Go to previous messageGo to next message
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
Re: XML Publisher date formatting [message #601740 is a reply to message #601663] Mon, 25 November 2013 03:19 Go to previous message
erporacleuser
Messages: 5
Registered: November 2013
Junior Member
Hi

Please try :

<?xdofx:to_char(P_FROM_DATE,'MM/DD/YYYY')?>

Rgds,
Previous Topic: Can I force uppercase on dashboard prompt value entry?
Next Topic: BI Publisher - Catastrophic Failure Error
Goto Forum:
  


Current Time: Thu Mar 28 08:20:43 CDT 2024