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

Function time_to_hms

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

Source from the content-addressed store, hash-verified

54}
55
56static inline void time_to_hms(std::int64_t jd,
57 std::int32_t & hour,
58 std::int32_t & min,
59 std::int32_t & sec,
60 std::int32_t & msec) {
61 std::int64_t time;
62 const std::int64_t USECS_PER_HOUR = 3600000000;
63 const std::int64_t USECS_PER_MINUTE = 60000000;
64 const std::int64_t USECS_PER_SEC = 1000000;
65 time = jd;
66 hour = time / USECS_PER_HOUR;
67 time -= (hour) *USECS_PER_HOUR;
68 min = time / USECS_PER_MINUTE;
69 time -= (min) *USECS_PER_MINUTE;
70 sec = time / USECS_PER_SEC;
71 msec = time - (sec * USECS_PER_SEC);
72}
73
74static inline int timestamp_to_tm(
75 std::int64_t dt, struct tm & tm, std::int32_t & msec) {

Callers 1

timestamp_to_tmFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected