Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 13th, 2010, 05:31 AM
Authorized User
 
Join Date: May 2009
Posts: 15
Thanks: 6
Thanked 0 Times in 0 Posts
Default Format Time

Hi I have the requirement where I need to convert the time from one format to other. Initially I have a requirement to convert from 2010-07-05T05:05:38.881 to 2010-07-05-05.05.38 which i am able to acheive using format-dateTime. Now I want the reverse case. can some one suggest can I convert using format-dateTime xpath function?

Input Time:
2010-07-05-05.05.38

Output:
2010-07-05T05:05:38.881
 
Old July 13th, 2010, 05:51 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You will have to use the string-handling functions such as replace(), substring(), xsl:analyze-string, etc.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old July 14th, 2010, 12:08 AM
Authorized User
 
Join Date: May 2009
Posts: 15
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Hi Micahel,

Thank you. I am able to acheive it. I am trying to use dateTime function with <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform".. which is incorrect. Changing to correct version 2.0 solved my issue.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Time Format Problem Dirk De Winnaar Visual Studio 2008 0 April 23rd, 2010 06:48 AM
date time format vb certified Pro VB 6 4 December 18th, 2009 08:16 AM
Time format MDM ASP.NET 2.0 Professional 2 July 12th, 2006 10:37 AM
Using xs:time to generate time in desired format krayan001 XSLT 0 June 27th, 2005 04:28 PM
Format Date Time ganesh15 PHP How-To 2 August 20th, 2003 05:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.