Web Analytics Made Easy -
StatCounter xslt date formatting - CodingForum

Announcement

Collapse
No announcement yet.

xslt date formatting

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • xslt date formatting

    Hello,

    I have a question about xslt:
    I have an xml document and I need to transform it to another xml document.
    One has a date formatted as: yyyy/mm/dd hh:mm:ss
    the other xml document should have the date 3 times in it:
    - once as a java timestamp: miliseconds since 1970 yada yada yada
    - once in the format: yyyy-mm-dd hh:mm
    - once in the format: dd/mm/yyyy

    The last two shouldn't be a problem.
    But the timestamp is giving me headaches
    Code:
    source xml file:
    <node date=2006/09/27 00:00:00">
    
    result xml file
    <date1>1159308000911</date1>
    <date2>2006-09-27 00:00</date2>
    <date3>27/09/2006</date3>
    How can I transform a textual date to a timestamp using xslt (is it even possible)?
    Should I use some external library?
    FYI: The xslt engine that will do the transformation is xalan

    Kind regards.

    Guy
    If you don't succeed at first, redefine succes
Working...
X