now
Returns the current date and time as a serial Julian date and time.
Excel: NOW
Controller: CodeCogs
Contents
Dependents
Interface
C++
Now
doublenow( | summerTimeRegion | Region = st_Local | ) |
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; }
- st_None : Applies no summer time alterations.
- st_Local: Applies the default local summer time alterations as defined by the C function
localtime
. This uses country setting of the underlying operating system to detect when summer daylight saving should be applied. We can not guarantee the operation oflocaltime
, so we generally recommend that this option is not used - except were you do not have doubts about the location the program is being run from.
Parameters
Region is 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
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.