mtime 1.2.2
Loading...
Searching...
No Matches
mtime_julianDay.h
Go to the documentation of this file.
1// Copyright (c) 2013-2024 MPI-M, Luis Kornblueh, Rahul Sinha and DWD, Florian Prill. All rights reserved.
2//
3// SPDX-License-Identifier: BSD-3-Clause
4//
19#ifndef _MTIME_JULIANDAY_H
20#define _MTIME_JULIANDAY_H
21
22#include <stdint.h>
23#include <stdbool.h>
24
32{
33 int64_t day;
34 int64_t ms;
35};
36
38/* Notice that Julian delta, as such, is not defined by any standard. In this lib,
39 it serves as a proxy for equivalent deltas on julian time scale. For example, a
40 TD of P02DT12H is equivalend to (2 days and 43200000 ms) Julian delta and -P02DT12H
41 is equivalent to (-2 days and -43200000 ms) */
42struct _juliandelta
43{
44 char sign;
45 int64_t day;
46 int64_t ms;
47};
50struct _julianday *newJulianDay(int64_t _day, int64_t _ms);
51
52void deallocateJulianDay(struct _julianday *jd);
53
54struct _juliandelta *newJulianDelta(char _sign, int64_t _day, int64_t _ms);
55
56void deallocateJulianDelta(struct _juliandelta *jd);
57
58struct _julianday *addJulianDeltaToJulianDay(struct _julianday *jd1, struct _juliandelta *jd2, struct _julianday *jd);
59
60struct _julianday *subtractJulianDeltaFromJulianDay(struct _julianday *jd1, struct _juliandelta *jd2, struct _julianday *jd);
61
63struct _juliandelta *subtractJulianDay(struct _julianday *jd1, struct _julianday *jd2, struct _juliandelta *jd);
66char *juliandayToString(struct _julianday *jd, char *toStr);
67
72#endif
int64_t ms
the milisecond on that particular day.
Definition mtime_julianDay.h:34
int64_t day
the actual Julian day.
Definition mtime_julianDay.h:33
void deallocateJulianDay(struct _julianday *jd)
Destructor of Julian-Date.
Definition mtime_julianDay.c:155
char * juliandayToString(struct _julianday *jd, char *toStr)
Get Julian as a string.
Definition mtime_julianDay.c:343
struct _julianday * newJulianDay(int64_t _day, int64_t _ms)
Construct new Julian-Date object.
Definition mtime_julianDay.c:44
Struct _julianday containing julian day parameters.
Definition mtime_julianDay.h:32