1
Fork 0
This repository has been archived on 2022-04-02. You can view files and clone it, but cannot push or open issues or pull requests.
UOC_PP20212_PR/UOC20212/UOCVaccine/include/date.h
2022-04-01 15:58:20 +02:00

31 lines
No EOL
805 B
C

#ifndef __DATE_H__
#define __DATE_H__
#include <stdbool.h>
typedef struct _tDate {
int day;
int month;
int year;
} tDate;
typedef struct _tTime {
int hour;
int minutes;
} tTime;
typedef struct _tDateTime {
tDate date;
tTime time;
} tDateTime;
// Parse a tDateTime from string information
void dateTime_parse(tDateTime* dateTime, const char* date, const char* time);
// Compare two tDateTime structures and return -1 if dateTime1<dateTime2, 0 if equals and 1 if dateTime1>dateTime2.
int dateTime_cmp(tDateTime dateTime1, tDateTime dateTime2);
// Compare two tDateTime structures and return true if they contain the same value or false otherwise.
bool dateTime_equals(tDateTime dateTime1, tDateTime dateTime2);
#endif // __DATE_H__