[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: format-number and time or ???

Subject: Re: format-number and time or ???
From: David_Marston@xxxxxxxxx
Date: Fri, 10 Nov 2000 15:28:50 -0500
format mod 60
Earlier I wrote:
concat(format-number($hours,'#0'),':',
       format-number($minutes,'00'),':',
       format-number($seconds,'00.###'))

If you start with $data containing the amount of time in seconds,
$seconds is ($data mod 60)
$minutes is ((floor($data div 60)) mod 60)
$hours  is  (floor($data div 3600))

If you start with $data containing the amount of time in minutes,
$seconds is (($data * 60) mod 60)
$minutes is (floor($data) mod 60)
$hours  is  (floor($data div 60))

If you start with $data containing the amount of time in hours,
$seconds is (($data * 3600) mod 60)
$minutes is (floor($data * 60) mod 60)
$hours  is  (floor($data))

The above formulae allow decimal fractions of a second to fall
through, which you'll trim in the formatting anyway. They also
allow $hours to be arbitrarily large, so you may want to expand
the format string (###0) or add another calculation for days.
.................David Marston


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.