19 using boost::date_time::not_a_date_time;
20 using boost::posix_time::nanoseconds;
21 using boost::posix_time::ptime;
22 using boost::posix_time::ptime_from_tm;
23 using boost::posix_time::to_tm;
25 DEFINE_bool(use_local_tz_for_unix_timestamp_conversions,
false,
26 "When true, TIMESTAMPs are interpreted in the local time zone when converting to "
27 "and from Unix times. When false, TIMESTAMPs are interpreted in the UTC time zone. "
28 "Set to true for Hive compatibility.");
52 time_t utc = timegm(&temp_tm);
53 if (
UNLIKELY(NULL == localtime_r(&utc, &temp_tm))) {
54 *
this = ptime(not_a_date_time);
59 ptime local = ptime_from_tm(temp_tm);
62 local += nanoseconds(
time_.fractional_seconds());
64 }
catch (std::exception& from_boost) {
65 *
this = ptime(not_a_date_time);
int Format(const DateTimeFormatContext &dt_ctx, int len, char *buff)
DEFINE_bool(use_local_tz_for_unix_timestamp_conversions, false,"When true, TIMESTAMPs are interpreted in the local time zone when converting to ""and from Unix times. When false, TIMESTAMPs are interpreted in the UTC time zone. ""Set to true for Hive compatibility.")
static bool Parse(const char *str, int len, boost::gregorian::date *d, boost::posix_time::time_duration *t)
boost::gregorian::date date_
4 -bytes - stores the date as a day
static int Format(const DateTimeFormatContext &dt_ctx, const boost::gregorian::date &d, const boost::posix_time::time_duration &t, int len, char *buff)
static const char * LLVM_CLASS_NAME
static const double ONE_BILLIONTH
ostream & operator<<(ostream &os, const map< TNetworkAddress, llama::TAllocatedResource > &resources)
bool HasDateAndTime() const
boost::posix_time::time_duration time_
8 bytes - stores the nanoseconds within the current day
std::string DebugString() const