OmniSciDB  95562058bd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DateTimeParser::DateTime Struct Reference

#include <DateTimeParser.h>

Public Member Functions

int64_t getTime (unsigned const dim) const
 

Public Attributes

int64_t Y {1970}
 
unsigned m {1}
 
unsigned d {1}
 
unsigned H {0}
 
unsigned M {0}
 
unsigned S {0}
 
unsigned n {0}
 
int z {0}
 
std::optional< bool > p
 

Friends

std::ostream & operator<< (std::ostream &, DateTime const &)
 

Detailed Description

Definition at line 50 of file DateTimeParser.h.

Member Function Documentation

int64_t DateTimeParser::DateTime::getTime ( unsigned const  dim) const

Definition at line 203 of file DateTimeParser.cpp.

References d, anonymous_namespace{DateTimeParser.cpp}::daysFromCivil(), H, m, M, n, p, anonymous_namespace{DateTimeParser.cpp}::pow_10, S, Y, and z.

Referenced by DateTimeParser::parse().

203  {
204  int64_t const days = daysFromCivil(Y, m, d);
205  int const seconds =
206  static_cast<int>(3600 * H + 60 * M + S) - z +
207  (p ? *p && H != 12 ? 12 * 3600 : !*p && H == 12 ? -12 * 3600 : 0 : 0);
208  return (24 * 3600 * days + seconds) * pow_10[dim] + n / pow_10[9 - dim];
209 }
std::optional< bool > p
int64_t daysFromCivil(int64_t y, unsigned const m, unsigned const d)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
DateTimeParser::DateTime const &  dt 
)
friend

Definition at line 387 of file DateTimeParser.cpp.

387  {
388  return out << dt.Y << '-' << dt.m << '-' << dt.d << ' ' << dt.H << ':' << dt.M << ':'
389  << dt.S << '.' << dt.n << " p("
390  << (dt.p ? *dt.p ? "true" : "false" : "unset") << ") z(" << dt.z << ')';
391 }
const int8_t const int64_t const uint64_t const int32_t const int64_t int64_t ** out

Member Data Documentation

unsigned DateTimeParser::DateTime::d {1}

Definition at line 53 of file DateTimeParser.h.

Referenced by getTime(), operator<<(), and DateTimeParser::updateDateTimeAndStr().

unsigned DateTimeParser::DateTime::H {0}

Definition at line 54 of file DateTimeParser.h.

Referenced by getTime(), operator<<(), and DateTimeParser::updateDateTimeAndStr().

unsigned DateTimeParser::DateTime::m {1}

Definition at line 52 of file DateTimeParser.h.

Referenced by getTime(), operator<<(), and DateTimeParser::updateDateTimeAndStr().

unsigned DateTimeParser::DateTime::M {0}

Definition at line 55 of file DateTimeParser.h.

Referenced by getTime(), operator<<(), and DateTimeParser::updateDateTimeAndStr().

unsigned DateTimeParser::DateTime::n {0}

Definition at line 57 of file DateTimeParser.h.

Referenced by getTime(), operator<<(), and DateTimeParser::updateDateTimeAndStr().

std::optional<bool> DateTimeParser::DateTime::p

Definition at line 59 of file DateTimeParser.h.

Referenced by getTime(), operator<<(), and DateTimeParser::updateDateTimeAndStr().

unsigned DateTimeParser::DateTime::S {0}

Definition at line 56 of file DateTimeParser.h.

Referenced by getTime(), operator<<(), and DateTimeParser::updateDateTimeAndStr().

int64_t DateTimeParser::DateTime::Y {1970}

Definition at line 51 of file DateTimeParser.h.

Referenced by getTime(), operator<<(), and DateTimeParser::updateDateTimeAndStr().

int DateTimeParser::DateTime::z {0}

Definition at line 58 of file DateTimeParser.h.

Referenced by getTime(), operator<<(), and DateTimeParser::updateDateTimeAndStr().


The documentation for this struct was generated from the following files: