8#ifndef INCLUDED_BDLT_EPOCHUTIL
9#define INCLUDED_BDLT_EPOCHUTIL
170#include <bdlscm_version.h>
182#include <bsl_ctime.h>
211 static const TimeT64 s_earliestAsTimeT64;
212 static const TimeT64 s_latestAsTimeT64;
415 return bsl::time_t(
static_cast<int>(dti.
totalSeconds()));
431 if (seconds > 0x7fffffffLL) {
435 *result =
static_cast<bsl::time_t
>(seconds);
459 if (time < s_earliestAsTimeT64 || time > s_latestAsTimeT64) {
477 datetime.
getTime(&hour, &minute, &second);
480 dt.
setTime(hour, minute, second);
499 return epoch() + timeInterval;
509 *result =
epoch() + timeInterval;
528 return epoch() + datetimeInterval;
538 *result =
epoch() + datetimeInterval;
544 return datetime -
epoch();
575 *result = datetime -
epoch();
Definition bdlt_datetimeinterval.h:201
int milliseconds() const
Definition bdlt_datetimeinterval.h:1137
bsls::Types::Int64 totalSeconds() const
Definition bdlt_datetimeinterval.h:1170
int microseconds() const
Definition bdlt_datetimeinterval.h:1144
Definition bdlt_datetime.h:331
Date date() const
Return the value of the "date" part of this object.
Definition bdlt_datetime.h:2164
void setTime(const Time &time)
Definition bdlt_datetime.h:1550
Datetime & addSeconds(bsls::Types::Int64 seconds)
Definition bdlt_datetime.h:2024
void getTime(int *hour, int *minute=0, int *second=0, int *millisecond=0, int *microsecond=0) const
Definition bdlt_datetime.h:2190
Definition bsls_timeinterval.h:301
BSLS_KEYWORD_CONSTEXPR_CPP14 void setInterval(bsls::Types::Int64 seconds, int nanoseconds=0)
Definition bsls_timeinterval.h:1245
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#define BSLS_REVIEW(X)
Definition bsls_review.h:949
Definition bbldc_basicisma30360.h:112
static const Datetime * epoch_1970_01_01()
Definition bdlt_epochutil.h:197
static Datetime convertFromDatetimeInterval(const DatetimeInterval &datetimeInterval)
Definition bdlt_epochutil.h:525
static Datetime convertFromTimeT64(TimeT64 time)
Definition bdlt_epochutil.h:443
static bsl::time_t convertToTimeT(const Datetime &datetime)
Definition bdlt_epochutil.h:404
static DatetimeInterval convertToDatetimeInterval(const Datetime &datetime)
Definition bdlt_epochutil.h:542
static Datetime convertFromTimeT(bsl::time_t time)
Definition bdlt_epochutil.h:383
static const Datetime & epoch()
Definition bdlt_epochutil.h:375
static Datetime convertFromTimeInterval(const bsls::TimeInterval &timeInterval)
Definition bdlt_epochutil.h:496
static TimeT64 convertToTimeT64(const Datetime &datetime)
Definition bdlt_epochutil.h:471
bsls::Types::Int64 TimeT64
Definition bdlt_epochutil.h:207
static bsls::TimeInterval convertToTimeInterval(const Datetime &datetime)
Definition bdlt_epochutil.h:513
long long Int64
Definition bsls_types.h:132