A set of methods for rendering calendrical and clock times. More...
Classes | |
| class | clock_time |
| A specific point in time as represented by a 24 hour clock. More... | |
| class | day_in_year |
| An object that represents a particular day in a year. More... | |
| class | time_locus |
| An object that represents a particular point in time. More... | |
| class | stopwatch |
| A class for measuring event durations in real time. More... | |
| class | time_control |
| Provides some functions that affect time, or ones perception of time. More... | |
| class | time_stamp |
| Represents a point in time relative to the operating system startup time. More... | |
| class | timeable |
| timeable is the base for objects that can be hooked into timer events. More... | |
| class | timer_driver |
| Provides platform-independent timer support. More... | |
Enumerations | |
| enum | days { SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY } |
| enum | months { JANUARY, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER } |
| enum | time_zones { LOCAL_ZONE, GREENWICH_ZONE } |
An enumeration of time zones, both relative and absolute. More... | |
Functions | |
| int | limit_day_of_month (int &day, int days_in_month, int days_in_prev_month) |
| time_locus | convert (const tm &to_convert, int ms) |
| time_locus | now () |
| returns our current locus in the time continuum. | |
| time_locus | greenwich_now () |
| returns Greenwich Mean Time (their now). | |
| clock_time | time_now () |
| what time is it? | |
| days | day_now () |
| Returns the current local day. | |
| months | month_now () |
| returns the local month. | |
| int | year_now () |
| what year is it? | |
| day_in_year | date_now () |
| what day on the calendar is it? | |
| const char * | day_name (days to_name) |
| Returns the name of the day "to_name". | |
| const char * | month_name (months to_name) |
| Returns the name of the month "to_name". | |
| const char * | short_month_name (months to_name) |
| Returns a shorter, constant-length (3 characters) month name. | |
| void | timer_driver_private_handler (int signal_seen) |
Variables | |
| const int | days_in_month [12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } |
| The number of days in each month in the standard year. | |
| const int | leap_days_in_month [12] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } |
| The number of days in each month in a leap year. | |
| const int | julian_days_in_month [12] = { 31, 29, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30 } |
| Number of days in each month based on the julian calendar. | |
| const int | julian_leap_days_in_month [12] = { 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30 } |
| Number of days in each month of a leap year in the julian calendar. | |
| const int | SECONDS_IN_MINUTE = 60 |
| Number of seconds in one minute. | |
| const int | MINUTES_IN_HOUR = 60 |
| Number of minutes in an hour. | |
| const int | HOURS_IN_DAY = 24 |
| Number of hours in a day. | |
| const int | DAYS_IN_YEAR = 365 |
| Number of days in a standard year. | |
| const int | LEAP_DAYS_IN_YEAR = 366 |
| Number of days in a leap year. | |
| const double | APPROX_DAYS_IN_YEAR = 365.2424 |
| A more accurate measure of the number of days in a year. | |
| const double | __rollover_point = 2.0 * MAXINT32 |
| const int | INITIAL_TIMER_GRANULARITY = 14 |
| const int | MAX_TIMER_PREDICTION = 140 |
| const int | PAUSE_TIME = 200 |
| const int | LONG_TIME = 1 * HOUR_ms |
| const int | OUR_SIGNAL = SIGUSR2 |
A set of methods for rendering calendrical and clock times.
It is based on the Gregorian calendar currently in use by the USA and other countries.
include <basis/astring.h> include <basis/contracts.h> include <basis/definitions.h>
| enum timely::days |
Definition at line 28 of file earth_time.h.
| enum timely::months |
Definition at line 36 of file earth_time.h.
| enum timely::time_zones |
An enumeration of time zones, both relative and absolute.
| LOCAL_ZONE |
The time zone this computer is configured to report. |
| GREENWICH_ZONE |
The time zone of Greenwich Mean Time. |
Definition at line 68 of file earth_time.h.
| time_locus timely::convert | ( | const tm & | to_convert, | |
| int | ms | |||
| ) |
Definition at line 308 of file earth_time.cpp.
References timely::day_in_year::day_in_month, timely::day_in_year::day_of_week, timely::day_in_year::day_of_year, timely::clock_time::hour, timely::clock_time::microsecond, timely::clock_time::millisecond, timely::clock_time::minute, timely::day_in_year::month, timely::clock_time::second, and timely::time_locus::year.
Referenced by octopi::octopus_request_id::from_text(), structures::version::v_build(), structures::version::v_major(), structures::version::v_minor(), and structures::version::v_revision().
| day_in_year timely::date_now | ( | ) |
what day on the calendar is it?
| const char * timely::day_name | ( | days | to_name | ) |
Returns the name of the day "to_name".
Referenced by timely::day_in_year::text_form().
| days timely::day_now | ( | ) |
Returns the current local day.
| time_locus timely::greenwich_now | ( | ) |
returns Greenwich Mean Time (their now).
| int timely::limit_day_of_month | ( | int & | day, | |
| int | days_in_month, | |||
| int | days_in_prev_month | |||
| ) |
Definition at line 199 of file earth_time.cpp.
Referenced by timely::day_in_year::normalize().
| const char * timely::month_name | ( | months | to_name | ) |
Returns the name of the month "to_name".
Referenced by timely::day_in_year::text_form().
| months timely::month_now | ( | ) |
returns the local month.
| time_locus timely::now | ( | ) |
returns our current locus in the time continuum.
Referenced by timely::timer_driver::handle_system_timer(), timely::time_stamp::notarize(), and filesystem::file_time::readable_text_form().
| const char * timely::short_month_name | ( | months | to_name | ) |
Returns a shorter, constant-length (3 characters) month name.
Referenced by timely::day_in_year::text_form().
| clock_time timely::time_now | ( | ) |
what time is it?
| void timely::timer_driver_private_handler | ( | int | signal_seen | ) |
Definition at line 82 of file timer_driver.cpp.
References DEFINE_CLASS_NAME, FUNCDEF, LOG, OUR_SIGNAL, and program_wide_timer.
Referenced by timely::timer_driver::timer_driver().
| int timely::year_now | ( | ) |
what year is it?
| const double timely::__rollover_point = 2.0 * MAXINT32 |
Definition at line 110 of file time_stamp.cpp.
Referenced by timely::time_stamp::rolling_uptime().
| const double timely::APPROX_DAYS_IN_YEAR = 365.2424 |
A more accurate measure of the number of days in a year.
This is the more accurate mean length of time in 24 hour days between vernal equinoxes. it's about 11 minutes shy of 365.25 days.
Definition at line 62 of file earth_time.h.
| const int timely::days_in_month = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } |
The number of days in each month in the standard year.
Definition at line 31 of file earth_time.cpp.
Referenced by timely::day_in_year::normalize().
| const int timely::DAYS_IN_YEAR = 365 |
Number of days in a standard year.
Definition at line 60 of file earth_time.h.
| const int timely::HOURS_IN_DAY = 24 |
Number of hours in a day.
Definition at line 59 of file earth_time.h.
| const int timely::INITIAL_TIMER_GRANULARITY = 14 |
Definition at line 43 of file timer_driver.cpp.
Referenced by timely::timer_driver::handle_system_timer(), and timely::timer_driver::timer_driver().
| const int timely::julian_days_in_month = { 31, 29, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30 } |
Number of days in each month based on the julian calendar.
Definition at line 37 of file earth_time.cpp.
| const int timely::julian_leap_days_in_month = { 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30 } |
Number of days in each month of a leap year in the julian calendar.
Definition at line 41 of file earth_time.cpp.
| const int timely::leap_days_in_month = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } |
The number of days in each month in a leap year.
Definition at line 34 of file earth_time.cpp.
Referenced by timely::day_in_year::normalize().
| const int timely::LEAP_DAYS_IN_YEAR = 366 |
Number of days in a leap year.
Definition at line 61 of file earth_time.h.
| const int timely::LONG_TIME = 1 * HOUR_ms |
Definition at line 56 of file timer_driver.cpp.
| const int timely::MAX_TIMER_PREDICTION = 140 |
Definition at line 47 of file timer_driver.cpp.
Referenced by timely::timer_driver::handle_system_timer().
| const int timely::MINUTES_IN_HOUR = 60 |
Number of minutes in an hour.
Definition at line 58 of file earth_time.h.
| const int timely::OUR_SIGNAL = SIGUSR2 |
Definition at line 66 of file timer_driver.cpp.
Referenced by timely::timer_driver::timer_driver(), timer_driver_private_handler(), and timely::timer_driver::~timer_driver().
| const int timely::PAUSE_TIME = 200 |
Definition at line 52 of file timer_driver.cpp.
Referenced by timely::timer_driver::~timer_driver().
| const int timely::SECONDS_IN_MINUTE = 60 |
Number of seconds in one minute.
Definition at line 57 of file earth_time.h.
1.6.3