I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
get GPL
COST (GBP)
this unit 0.56
sub units 0.00
+
0
UnitsTime

time

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

get GPL add to cart

Interface

C++
Excel

Time

 
doubletimeintHours
intMinutes
intSeconds )[inline]
Calculates the fraction of a day represented by the specified time (Hours, Minutes and Seconds), using the formula:

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

References:

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

Source code is available when you agree to a GP Licence or buy a Commercial Licence.

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