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

Valid RSS

UnitsTime

now

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

Returns the current date and time as a serial Julian date and time. Excel: NOW

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

Interface

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

using namespace Units::Time;

double now (summerTimeRegion Region=st_Local)
Returns the current date and time as a serial Julian date and time. Excel: NOW

Function Documentation

 
doublenowsummerTimeRegionRegion = st_Local )
Returns the current date and time as a serial Julian date, with time expressed as a fraction of the overall (24hr day), i.e.
date = Julian\ Days + \frac{3600 hours + 60 minutes + seconds}{24 *3600}
where hours, minutes and seconds are derived from the local system time. This function then uses summerTime to make appropriate adjustment for summer daylight saving.
Example 1:
#include <stdio.h>
#include <codecogs/units/time/now.h>
#include <codecogs/units/date/day.h>
#include <codecogs/units/date/month_str.h>
#include <codecogs/units/date/month.h>
#include <codecogs/units/date/year.h>
#include <codecogs/units/time/hour.h>
#include <codecogs/units/time/minute.h>
#include <codecogs/units/time/second.h>
 
using namespace Units::Time;
using namespace Units::Date;
 
int main()
{
  double a=now(st_UK);
  printf("\n\n Is is now the %d %s %04d %2d:%02d:%02d",
         day((int)a), month_str(month((int)a)), year((int)a),
         hour(a), minute(a), second(a));
  return 0;
}

Parameters:
Regionis the location or country for which the existence of summer time is required, see summerTimeRegion for codes. For ease, there are two additional options that can be specified:
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-15 01:25:31

Valid CSS!   Valid XHTML 1.0 Transitional