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 February 11th, 2010, 01:41 PM
Authorized User
 
Join Date: May 2007
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Default Convert minutes to hh:mm

I am trying to find the most efficient way (using XSLT 2.0) to convert minutes to hh:mm format. Is there a built in function that already does that?

Thanks!
 
Old February 11th, 2010, 01:52 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Code:
format-time(xs:time('00:00:00Z')+$minutes*xs:dayTimeDuration('PT1M'), '[H01]:[M01]')
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old February 11th, 2010, 01:57 PM
Authorized User
 
Join Date: May 2007
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Amazing. Thanks!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert seconds to HH:MM:SS bph SQL Server 2000 11 July 31st, 2009 01:53 PM
converting HH:MM to HH.MM nasirmunir PHP How-To 5 July 11th, 2008 01:33 PM
Convert time in seconds to hh:mm:ss 41509331 C++ Programming 0 March 18th, 2008 04:43 AM
Convert Seconds to HH:MM:SS jpillonel Crystal Reports 0 December 17th, 2003 09:20 AM
validation of [HH]:mm beastwood_uk Excel VBA 3 August 10th, 2003 08:37 AM





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