|
Turi Create
4.0
|
#include <core/data/flexible_type/flexible_type_base_types.hpp>
Public Member Functions | |
| flex_date_time (int64_t posix_timestamp, int32_t tz_15min_offset=EMPTY_TIMEZONE, int32_t microsecond=0) | |
| int64_t | posix_timestamp () const |
| int64_t | shifted_posix_timestamp () const |
| void | set_posix_timestamp (int64_t ts) |
| double | microsecond_res_timestamp () const |
| void | set_microsecond_res_timestamp (double d) |
| int32_t | microsecond () const |
| void | set_microsecond (int32_t microsecond) |
| int32_t | time_zone_offset () const |
| void | set_time_zone_offset (int32_t tz_15min_offset) |
| bool | operator< (const flex_date_time &other) const |
| Less than comparator. | |
| bool | operator> (const flex_date_time &other) const |
| Greater than comparator. | |
| bool | operator== (const flex_date_time &other) const |
| Equality comparator, timezone is ignored. | |
| bool | identical (const flex_date_time &other) const |
| Equality comparator, timezone is checked. | |
Static Public Attributes | |
| static constexpr int64_t | MICROSECONDS_PER_SECOND = 1000000 |
| Number of microseconds in 1 second. | |
| static constexpr double | MICROSECOND_EPSILON = 1.0 / (2 * MICROSECONDS_PER_SECOND) |
| static constexpr int32_t | TIMEZONE_LOW = -12 * 4 |
| lowest value for timezone. 12 hours * 4 (15 min resolution) | |
| static constexpr int32_t | TIMEZONE_HIGH = 12 * 4 |
| highest value for timezone. 12 hours * 4 (15 min resolution) | |
| static constexpr int32_t | EMPTY_TIMEZONE = 64 |
| Value denoting an invalid timezone. | |
| static constexpr int32_t | TIMEZONE_RESOLUTION_IN_SECONDS = 15 * 60 |
| timezone resolution is stored in 15 minute intervals (15*60 seconds) | |
| static constexpr int32_t | TIMEZONE_RESOLUTION_IN_MINUTES = 15 |
| timezone resolution is stored in 15 minute intervals (15 minutes) | |
| static constexpr double | TIMEZONE_RESOLUTION_IN_HOURS = 0.25 |
| timezone resolution is stored in 15 minute intervals (1/4 hour) | |
A date_time object that can be stored in a flexible_type. Corresponds to the type enum flex_type_enum::DATETIME flex_date_time.first is utc timestamp and flex_date_time.second is the timezone offset.
Definition at line 77 of file flexible_type_base_types.hpp.
|
inlineexplicit |
Constructs a flex_date_time object from a posix timestamp, and and time zone offset.
| posix_timestamp | Timestamp value since 1st Jan 1970 UTC |
| tz_15_min_offset | Additional offset for timezone. In integral increments of 15 minutes. If EMPTY_TIMEZONE, or not provided, there is no timezone information |
| microsecond | Microsecond value |
Definition at line 114 of file flexible_type_base_types.hpp.
|
inline |
Returns the timestamp value.
Definition at line 183 of file flexible_type_base_types.hpp.
|
inline |
Returns the timestamp in a floating point value including the microsecond interval.
Definition at line 159 of file flexible_type_base_types.hpp.
|
inline |
Returns the timestamp value at UTC
Definition at line 125 of file flexible_type_base_types.hpp.
|
inline |
Returns the timestamp value.
Definition at line 190 of file flexible_type_base_types.hpp.
|
inline |
Sets the timestamp from a floating point value including the microsecond interval.
Definition at line 171 of file flexible_type_base_types.hpp.
|
inline |
Sets the posix timestamp value
Definition at line 146 of file flexible_type_base_types.hpp.
|
inline |
Sets the time zone value in integral increments of 15 min
Definition at line 212 of file flexible_type_base_types.hpp.
|
inline |
Returns the timestamp value adding the timezone shift
Definition at line 138 of file flexible_type_base_types.hpp.
|
inline |
Returns the time zone value in integral increments of 15 min
Definition at line 200 of file flexible_type_base_types.hpp.
|
static |
When doing time comparisons against floating point values, this is the epsilon to use. This is 0.5 microseconds in seconds
Definition at line 83 of file flexible_type_base_types.hpp.