8 : outputFormat(outputFormat) {
10 switch (inputFormat) {
15 time = value +
Float(2'400'000. * 60. * 60. * 24.);
18 time = value +
Float(2'400'000.5 * 60. * 60. * 24.);
24 const char* format = outputFormat.c_str();
28 const int y = 4716, j = 1401, m = 2, n = 12, r = 4, p = 1461, v = 3, u = 5, s = 153, w = 2, B = 274'277,
33 const Float timeInDays = time / (60. * 60. * 24.) + 0.5_f;
34 const Float remainder = timeInDays -
floor(timeInDays);
35 const int J = int(timeInDays);
37 const int f = J + j + (((4 * J + B) / 146097) * 3) / 4 + C;
38 const int e = r * f + v;
39 const int g = (e % p) / r;
40 const int h = u * g + w;
42 const int D = (h % s) / u + 1;
43 const int M = (h / s + m) % n + 1;
44 const int Y = (e / p) - y + (n + m - M) / n;
46 for (
const char* c = format; *c; ++c) {
48 ss << std::setw(2) << std::setfill(
'0');
63 ss << int(remainder * 24) % 24;
66 ss << int(remainder * 24 * 60) % 60;
69 ss << int(remainder * 24 * 60 * 60) % 60;
#define SPH_ASSERT(x,...)
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
INLINE auto floor(const T &f)
#define NAMESPACE_SPH_END