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 January 11th, 2010, 10:38 AM
Authorized User
 
Join Date: May 2007
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Default convert dateTime format

Hi,

I am receiving a dateTime as follows:

2010-11-07T00:00:00-0500

But need to convert the DST offset to be xs:dateTime compliant (requiring a : between the offset hour and minutes):

2010-11-07T00:00:00-05:00

Does anyone know of the best way to do this? I was thinking this might be a common problem that has been addressed before.

Thanks,
Chelsea
 
Old January 11th, 2010, 10:54 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

In XSLT, concat(substring($in, 1, 22)), ':', substring($in, 23, 2)), if I have counted correctly.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert DateTime Format dnyanubhamare C# 2005 2 February 25th, 2008 09:06 AM
Convert British format date to American format? fyr PHP How-To 0 December 19th, 2007 03:17 PM
Convert Rich Text Format to Ordinary Format in ASP Andraw Classic ASP Basics 1 August 31st, 2007 10:05 AM
How to convert a string in DateTime elena SQL Language 6 March 29th, 2006 06:59 PM
Convert DateTime rgerald SQL Server 2000 3 October 5th, 2004 09:00 PM





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