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

hour

Returns the current hour from a serial Julian date and time. Excel: HOUR
Controller: CodeCogs

get GPL add to cart

Interface

C++
Excel
HTML

Hour

 
inthourdoubletime )[inline]
Returns the hour within a serial Julian date and time values. Care must be taken in handling rounding errors appropriately, because time is expressed as a fraction of a 24hr day. Therefore 1hr is ~0.041666 days. Given this fraction, this function first calculates the number of seconds that have lapsed into the current day, rounding to the nearest second. The seconds are then converting in a whole number of hours.

Example 1

#include <stdio.h>
#include <codecogs/units/time/now.h>
#include <codecogs/units/time/hour.h> 
using namespace Units::Time;
 
int main()
{
  printf("\n The current hour using USA daylight saving is", hour(now(st_USA)));
  printf("\n The current hour using European daylight saving is", hour(now(st_EU)));
  return 0;
}

Parameters

timeis the serial Julian date and time value.

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.