MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / lbug_date_to_tm

Function lbug_date_to_tm

src/c_api/value.cpp:1336–1351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1334}
1335
1336lbug_state lbug_date_to_tm(lbug_date_t date, struct tm* out_result) {
1337 time_t time = date.days * 86400;
1338#ifdef _WIN32
1339 if (convertTimeToTm(time, out_result) != 0) {
1340 return LbugError;
1341 }
1342#else
1343 if (gmtime_r(&time, out_result) == nullptr) {
1344 return LbugError;
1345 }
1346#endif
1347 out_result->tm_hour = 0;
1348 out_result->tm_min = 0;
1349 out_result->tm_sec = 0;
1350 return LbugSuccess;
1351}
1352
1353lbug_state lbug_date_from_tm(struct tm tm, lbug_date_t* out_result) {
1354#ifdef _WIN32

Callers 2

TEST_FFunction · 0.85
lbug_date_to_stringFunction · 0.85

Calls 1

convertTimeToTmFunction · 0.85

Tested by 1

TEST_FFunction · 0.68