mtime 1.3.0
Loading...
Searching...
No Matches
mtime_time.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_TIME_H
21#define _MTIME_TIME_H
22
23#include <stdint.h>
24
31struct _time
32{
33 int hour;
34 int minute;
35 int second;
36 int ms;
37};
38
39struct _time *newTime(const char *time_string);
40
41struct _time *newRawTime(int _hour, int _minute, int _second, int _ms);
42
43struct _time *constructAndCopyTime(struct _time *t);
44
45void deallocateTime(struct _time *t);
46
47struct _time *replaceTime(struct _time *, struct _time *);
48
49char *timeToString(struct _time *, char *);
50
51char *timeToBasicString(struct _time *, char *);
52
53char *timeToPosixString(struct _time *t, char *toStr, char *fmtString);
54
58#endif
int hour
hour part of time.
Definition mtime_time.h:33
int minute
minute part of time.
Definition mtime_time.h:34
int ms
milli-second part of time. 0<=ms<=999.
Definition mtime_time.h:36
int second
second part of time.
Definition mtime_time.h:35
struct _time * newRawTime(int _hour, int _minute, int _second, int _ms)
Construct new Time using 'raw' numerical values.
Definition mtime_time.c:136
void deallocateTime(struct _time *t)
Destructor of Time.
Definition mtime_time.c:179
char * timeToBasicString(struct _time *, char *)
Get time as a basic string.
Definition mtime_time.c:266
char * timeToPosixString(struct _time *t, char *toStr, char *fmtString)
Get Time in 'struct tm' format and return as a string.
Definition mtime_time.c:297
struct _time * replaceTime(struct _time *, struct _time *)
COPY a time object.
Definition mtime_time.c:204
struct _time * constructAndCopyTime(struct _time *t)
Copy the values and construct a new Time.
Definition mtime_time.c:163
char * timeToString(struct _time *, char *)
Get time as an extended string.
Definition mtime_time.c:236
struct _time * newTime(const char *time_string)
Construct new Time using an ISO 8601 conforming string.
Definition mtime_time.c:60
struct _time containing usual time parameters.
Definition mtime_time.h:32