OmniSciDB  ba1bac9284
 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 60 of file DateTimeParser.h.

Member Function Documentation

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

Definition at line 207 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().

207  {
208  int64_t const days = daysFromCivil(Y, m, d);
209  int const seconds =
210  static_cast<int>(3600 * H + 60 * M + S) - z +
211  (p ? *p && H != 12 ? 12 * 3600 : !*p && H == 12 ? -12 * 3600 : 0 : 0);
212  return (24 * 3600 * days + seconds) * pow_10[dim] + n / pow_10[9 - dim];
213 }
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 396 of file DateTimeParser.cpp.

396  {
397  return out << dt.Y << '-' << dt.m << '-' << dt.d << ' ' << dt.H << ':' << dt.M << ':'
398  << dt.S << '.' << dt.n << " p("
399  << (dt.p ? *dt.p ? "true" : "false" : "unset") << ") z(" << dt.z << ')';
400 }

Member Data Documentation

unsigned DateTimeParser::DateTime::d {1}

Definition at line 63 of file DateTimeParser.h.

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

unsigned DateTimeParser::DateTime::H {0}

Definition at line 64 of file DateTimeParser.h.

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

unsigned DateTimeParser::DateTime::m {1}

Definition at line 62 of file DateTimeParser.h.

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

unsigned DateTimeParser::DateTime::M {0}

Definition at line 65 of file DateTimeParser.h.

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

unsigned DateTimeParser::DateTime::n {0}

Definition at line 67 of file DateTimeParser.h.

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

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

Definition at line 69 of file DateTimeParser.h.

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

unsigned DateTimeParser::DateTime::S {0}

Definition at line 66 of file DateTimeParser.h.

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

int64_t DateTimeParser::DateTime::Y {1970}

Definition at line 61 of file DateTimeParser.h.

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

int DateTimeParser::DateTime::z {0}

Definition at line 68 of file DateTimeParser.h.

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


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