mtime 1.2.2
Loading...
Searching...
No Matches
mtime_date.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//
20#ifndef _MTIME_DATE_H
21#define _MTIME_DATE_H
22
23#include "mtime_calendar.h"
24
31struct _date
32{
33 int64_t year;
34 int month;
35 int day;
36};
37
38struct _date *newDate(const char *ds);
39
40struct _date *newRawDate(int64_t _year, int _month, int _day);
41
42struct _date *constructAndCopyDate(struct _date *d);
43
44void deallocateDate(struct _date *d);
45
47compare_return_val compareDate(struct _date *, struct _date *);
50struct _date *replaceDate(struct _date *, struct _date *);
51
52char *dateToString(struct _date *, char *ds);
53
54char *dateToBasicString(struct _date *, char *ds);
55
56char *dateToPosixString(struct _date *d, char *toStr, char *fmtString);
57
61#endif
int day
day of date.
Definition mtime_date.h:35
int64_t year
Year of date. Can be both positive and negative.
Definition mtime_date.h:33
int month
Month of date.
Definition mtime_date.h:34
char * dateToString(struct _date *, char *ds)
Get Date as an extended string.
Definition mtime_date.c:273
struct _date * replaceDate(struct _date *, struct _date *)
COPY a Date object.
Definition mtime_date.c:241
struct _date * constructAndCopyDate(struct _date *d)
Copy the values and construct a new date.
Definition mtime_date.c:136
struct _date * newDate(const char *ds)
Construct new Date using an ISO 8601 conforming string.
Definition mtime_date.c:61
char * dateToBasicString(struct _date *, char *ds)
Get Date as a basic string.
Definition mtime_date.c:303
char * dateToPosixString(struct _date *d, char *toStr, char *fmtString)
Get Date in 'struct tm' format and return as a string.
Definition mtime_date.c:341
void deallocateDate(struct _date *d)
Destructor of Date. Free the Date object.
Definition mtime_date.c:152
struct _date * newRawDate(int64_t _year, int _month, int _day)
Construct new Date using 'raw' numerical values.
Definition mtime_date.c:113
struct _date containing usual date parameters.
Definition mtime_date.h:32
Singleton Calendar connecting all supported calendar types.