mtime 1.3.0
|
TimeDelta and some operations supported on TimeDelta. More...
Go to the source code of this file.
Data Structures | |
struct | _timedelta |
Struct _timedelta containing timedelta and sign of year parameter. More... | |
struct | _divisionquotienttimespan |
Struct _divisionquotienttimespan is used for storing division of two time-delta results. More... | |
Functions | |
struct _timedelta * | newTimeDelta (const char *timedelta_string) |
Construct new TimeDelta using an ISO 8601 conforming string. | |
struct _timedelta * | newRawTimeDelta (char _sign, int64_t _year, int _month, int _day, int _hour, int _minute, int _second, int _ms) |
Construct new TimeDelta using 'raw' numerical values. | |
struct _timedelta * | constructAndCopyTimeDelta (struct _timedelta *td) |
Copy the values and construct a new TimeDelta. | |
void | deallocateTimeDelta (struct _timedelta *td) |
Destructor of TimeDelta. | |
compare_return_val | compareTimeDelta (struct _timedelta *td1, struct _timedelta *td2) |
Compare two timedelta and return (td1 > td2) OR (td1 = td2) OR (td1 < td2). | |
struct _timedelta * | replaceTimeDelta (struct _timedelta *tdsrc, struct _timedelta *tddest) |
COPY a TimeDelta object. | |
struct _juliandelta * | timeDeltaToJulianDelta (struct _timedelta *td, struct _datetime *dt, struct _juliandelta *jd) |
struct _timedelta * | julianDeltaToTimeDelta (struct _juliandelta *jd, struct _datetime *dt, struct _timedelta *td_return) |
struct _divisionquotienttimespan * | divideTimeDeltaInSeconds (struct _timedelta *dividend, struct _timedelta *divisor, struct _divisionquotienttimespan *quo_ret) |
struct _divisionquotienttimespan * | divideTwoDatetimeDiffsInSeconds (struct _datetime *dt1_dividend, struct _datetime *dt2_dividend, struct _datetime *dt1_divisor, struct _datetime *dt2_divisor, int64_t *denominator_ret, struct _divisionquotienttimespan *quo_ret) |
division of two differences in datetimes. | |
struct _divisionquotienttimespan * | divideDatetimeDifferenceInSeconds (struct _datetime *dt1, struct _datetime *dt2, struct _timedelta *divisor, struct _divisionquotienttimespan *quo_ret) |
division by an interval given in of seconds. | |
struct _timedelta * | getTimeDeltaFromDate (struct _date *, struct _date *, struct _timedelta *) |
Get the TimeDelta between two Dates d1 and d2 as (d1-d2). | |
struct _timedelta * | getTimeDeltaFromDateTime (struct _datetime *dt1, struct _datetime *dt2, struct _timedelta *td_return) |
Get the TimeDelta between two DateTimes dt1 and dt2 as (dt1-dt2). | |
int64_t | getTotalMilliSecondsTimeDelta (struct _timedelta *td, struct _datetime *dt) |
Get total number of milliseconds in timedelta. | |
int64_t | getTotalSecondsTimeDelta (struct _timedelta *td, struct _datetime *dt) |
Get total number of seconds in timedelta. | |
char * | timedeltaToString (struct _timedelta *td, char *toString) |
Get TimeDelta as an extended string. | |
struct _date * | addTimeDeltaToDate (struct _date *dt, struct _timedelta *td, struct _date *dt_return) |
Add timedelta to Date. | |
struct _datetime * | addTimeDeltaToDateTime (struct _datetime *dt, struct _timedelta *td, struct _datetime *dt_return) |
Add timedelta to DateTime. | |
struct _timedelta * | moduloTimeDeltaFromDateTime (struct _datetime *start_dt, struct _timedelta *timestep, struct _datetime *current_dt, struct _timedelta *modulo_td) |
Get the timedelta between current_dt and start_dt plus next integral-multiple-of-timestep (timedelta). | |
struct _timedelta * | elementwiseScalarMultiplyTimeDelta (struct _timedelta *base_td, int64_t lambda, struct _timedelta *scaled_td) |
Return the element-wise product of a scalar and a timedelta. | |
struct _timedelta * | elementwiseAddTimeDeltatoTimeDelta (struct _timedelta *td1, struct _timedelta *td2, struct _timedelta *td_return) |
Return the element-wise sum of two timedeltas. | |
int64_t | moduloTimedelta (struct _timedelta *a, struct _timedelta *p, int64_t *quot) |
Returns the remainder of timedelta a modulo timedelta p. | |
char * | getPTStringFromMS (int64_t _ms, char *PTstr) |
Return a PT String corresponding to arbitrary number of milliseconds. | |
char * | getPTStringFromSeconds (int64_t _s, char *PTstr) |
Return a PT String corresponding to arbitrary number of seconds. | |
char * | getPTStringFromSecondsFloat (float _s, char *PTstr) |
Return a PT String corresponding to arbitrary number of seconds. | |
char * | getPTStringFromSecondsDouble (double _s, char *PTstr) |
Return a PT String corresponding to arbitrary number of seconds. | |
char * | getPTStringFromMinutes (int64_t _m, char *PTstr) |
Return a PT String corresponding to arbitrary number of minutes. | |
char * | getPTStringFromHours (int64_t _h, char *PTstr) |
Return a PT String corresponding to arbitrary number of Hours. | |
TimeDelta and some operations supported on TimeDelta.