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 November 27th, 2006, 12:25 PM
Registered User
 
Join Date: Nov 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Converting dates

Hi,

I'm transforming XML->XML and I need to convert a date in the format 01-01-2006 to the format 2006-01-01.

How's it done?

Thanks,
Alex

 
Old November 27th, 2006, 01:31 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

It's not clear whether your're converting from MM-DD-YYYY or from DD-MM-YYYY. Either way, you use concat() with three calls of substring() to extract the relevant parts of the input string.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
converting dates: day of week stolte XSLT 2 November 28th, 2007 11:24 AM
dates again dhoward VB.NET 2002/2003 Basics 12 August 22nd, 2007 09:48 AM
converting dates dhoward VB.NET 2002/2003 Basics 6 August 2nd, 2007 08:42 AM
Converting Dates mg1966 Classic ASP Databases 1 January 19th, 2005 09:15 AM
converting dates Bhavin Crystal Reports 1 October 13th, 2004 10:00 AM





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