| XML Publisher date formatting [message #303888] |
Mon, 03 March 2008 02:35  |
daibatzu Messages: 34 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: 34 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   |
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  |
|
|
Thank you i also have the same problem it is useful to me.
|
|
|