MCPcopy Create free account
hub / github.com/BlazingDB/blazingsql / date_to_string

Function date_to_string

engine/src/io/data_parser/sql/PostgreSQLParser.cpp:95–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95static inline std::string date_to_string(std::int32_t jd) {
96 // For date conversion see
97 // https://doxygen.postgresql.org/backend_2utils_2adt_2datetime_8c.html#a889d375aaf2a25be071d818565142b9e
98 const std::int32_t POSTGRESQL_EPOCH_DATE = 2451545;
99 std::int32_t year, month, day;
100 date_to_ymd(POSTGRESQL_EPOCH_DATE + jd, year, month, day);
101 std::stringstream oss;
102 oss << year << '-' << std::setfill('0') << std::setw(2) << month << '-'
103 << std::setw(2) << day;
104 return oss.str();
105}
106
107static inline std::string timestamp_to_string(std::int64_t tstamp) {
108 // For timestamp conversion see

Callers 1

parse_cudf_stringMethod · 0.85

Calls 1

date_to_ymdFunction · 0.85

Tested by

no test coverage detected