CodeCogs - An iteractive open source Numerical library Welcome... Login
CodeCogs
shopping cart
OSXWindowsLinux
Search CodeCogs
Numerical Components

Valid RSS

UnitsTime

time

Available under GPL (Free) and Commercial licence
get a GPL licence
COST (GBP)
this unit 0.47
sub units 0.00
add a commercial licence to your cart
0
viewed 1886 times and licensed 30 times

Calculates the time fraction from the parameters \b hours, \b minutes and \b seconds. Excel: TIME

Controller: CodeCogs  Contact Controller
+View version details
Contents hide toc
buy now     get GPL     add to cart

Interface

#include <codecogs/units/time/time.h>

using namespace Units::Time;

double time (int Hours, int Minutes, int Seconds)[inline]
Calculates the time fraction from the parameters hours, minutes and seconds. Excel: TIME
ExcelReal cc_time (Integer Hours, Integer Minutes, Integer Seconds)
This function is available as a Microsoft Excel add-in.

Function Documentation

Time Calculator
  
Add calculator to website or email
 
doubletimeintHours
intMinutes
intSeconds )[inline]
Calculates the fraction of a day represented by the specified time (Hours, Minutes and Seconds), using the formula:
time = \frac{3600 hours + 60 minutes + seconds}{24 *3600}

Therefore time=0 is midnight, time=0.5 is midday, and time=1 is the start of the next day.

Example:

double breakfast =time(6,15,0);    // ~0.2604
  double midday    =time(12,0,0);    // 0.5
  double lunchtime =time(13,30,0);   // ~0.5625
  double bedtime   =time(22,40,0);   // ~0.9444
Parameters:
Hoursis usually any integer number between 0 (12am) and 23 (11pm), though values outside of this range will esculate into forming a positive (or negative) number of elapsed days.
Minutesis usually any integer between 0 and 59, where once again values outside of this range will esculate into forming additional hours.
Secondsis usually any integer between 0 and 59, with values outside of this range esculating upto to form whole minutes.
Authors:
Will Bateman (Sep 2004)
Source Code:

To view or download source code you need either a GPL or Commercial Licence.

buy now     get GPL     add to cart

Not a member, then Register with CodeCogs. Already a Member, then Login.


Page Comments

Format Excel Equations

  You must login to leave a messge


Last Modified: 18 Oct 07 @ 17:07     Page Rendered: 2010-03-10 12:56:51

Valid CSS!   Valid XHTML 1.0 Transitional