Medial Code Documentation
|
The following is a class to handle time conversions There's a global instance of it declared below (med_time_convert) to be used in conversions. More...
#include <MedTime.h>
Public Member Functions | |
bool | is_valid_date (int date) const |
int | convert_times (int from_type, int to_type, int in_time) |
Converts time formats. | |
int | convert_times (int from_type, int to_type, double in_time) |
double | convert_times_D (int from_type, int to_type, int in_time) |
double | convert_times_D (int from_type, int to_type, double in_time) |
string | convert_times_S (int from_type, int to_type, int in_time) |
void | init_time_tables () |
init of time table | |
int | convert_date (int to_type, int in_time) |
Converts time formats from date format as input. | |
int | convert_datetime (int to_type, string in_time) |
converts from YYYYMMDDHHMI format | |
int | convert_datetime_safe (int to_type, string in_time, char handle_ilegal_date=2) |
converts from YYYYMMDDHHMI format include warning in dates before 1900 - for loading. | |
int | convert_years (int to_type, int in_time) |
int | convert_months (int to_type, int in_time) |
int | convert_days (int to_type, int in_time) |
int | convert_hours (int to_type, int in_time) |
int | convert_minutes (int to_type, int in_time) |
int | add_subtruct_days (int in_time, int delta_days) |
int | string_to_type (const string &str) |
Convert string to type. | |
string | type_to_string (int type) |
Converts type to string. | |
int | diff_times (int d1, int d2, int in_type, int out_type) |
double | diff_times_D (int d1, int type1, int d2, int type2, int out_type) |
int | diff_times (int d1, int type1, int d2, int type2, int out_type) |
double | get_age (int t, int type_t, int byear) |
double | get_age_from_bdate (int t, int type_t, int bdate) |
int | add_subtract_time (int in_time, int in_type, int delta_time, int delta_type) |
subtract time (truncating negative values) | |
The following is a class to handle time conversions There's a global instance of it declared below (med_time_convert) to be used in conversions.
int MedTime::convert_date | ( | int | to_type, |
int | in_time | ||
) |
Converts time formats from date format as input.
usefull for converting dates to days from 1900 for example to calculate days diff.
int MedTime::convert_datetime | ( | int | to_type, |
string | in_time | ||
) |
converts from YYYYMMDDHHMI format
handles YYYYMMDD and YYYY-MM-DD HH:MI:SS formats
int MedTime::convert_datetime_safe | ( | int | to_type, |
string | in_time, | ||
char | handle_ilegal_date = 2 |
||
) |
converts from YYYYMMDDHHMI format include warning in dates before 1900 - for loading.
handle_ilegal_date [0 - hanldes quitely truncate to 1900, 1- shows warning and truncate, 2 - throws error]
int MedTime::convert_times | ( | int | from_type, |
int | to_type, | ||
int | in_time | ||
) |
Converts time formats.
usefull for converting dates to days from 1900 for example to calculate days diff.