Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XSL Date formatting

Reply
Thread Tools

XSL Date formatting

 
 
Suvig
Guest
Posts: n/a
 
      04-01-2004
The XML I have has the NEWS-PRESSDATE attribute. But, the date is in
number format (in milli-seconds):
* <NEWS-PRESSDATE>1080018000000</NEWS-PRESSDATE>

Q: How do I convert this to for format I want to display?
"March 23, 2004"
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      04-02-2004


Suvig wrote:

> The XML I have has the NEWS-PRESSDATE attribute. But, the date is in
> number format (in milli-seconds):
> <NEWS-PRESSDATE>1080018000000</NEWS-PRESSDATE>
>
> Q: How do I convert this to for format I want to display?
> "March 23, 2004"


I don't think XPath 1.0 or XSLT 1.0 has functions to convert a value in
milliseconds (since Jan 1 1970 UTC??) to a date so you would need to use
an extension function which is very processor dependant or you need to
look for a XSLT library which you can use. Maybe
http://www.exslt.org/date/index.html
has some function you can use
--

Martin Honnen
http://JavaScript.FAQTs.com/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XSL Question tp xsl:for-each and xsl:variable schaf@2wire.ch XML 1 05-27-2005 09:25 PM
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM
Given a date, how to find the beginning date and ending date of that week Matt ASP .Net 1 11-08-2003 09:14 PM
Given a date, how to find the beginning date and ending date of that week Matt C Programming 3 11-08-2003 09:07 PM
Given a date, how to find the beginning date and ending date of that week Matt C++ 2 11-08-2003 08:30 PM



Advertisments