mikroSDK Reference Manual
date_time.h
Go to the documentation of this file.
1
29#ifndef _DATE_TIME_H
30#define _DATE_TIME_H
31
32//Dependencies
33#include <time.h>
34#include "os_port.h"
35
36//C++ guard
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41
46typedef struct
47{
48 uint16_t year;
49 uint8_t month;
50 uint8_t day;
51 uint8_t dayOfWeek;
52 uint8_t hours;
53 uint8_t minutes;
54 uint8_t seconds;
55 uint16_t milliseconds;
56} DateTime;
57
58
59//Date and time management
60const char_t *formatSystemTime(systime_t time, char_t *str);
61const char_t *formatDate(const DateTime *date, char_t *str);
62
63void getCurrentDate(DateTime *date);
64time_t getCurrentUnixTime(void);
65
66void convertUnixTimeToDate(time_t t, DateTime *date);
67time_t convertDateToUnixTime(const DateTime *date);
68
69int_t compareDateTime(const DateTime *date1, const DateTime *date2);
70
71uint8_t computeDayOfWeek(uint16_t y, uint8_t m, uint8_t d);
72
73//C++ guard
74#ifdef __cplusplus
75}
76#endif
77
78#endif
RTOS abstraction layer.
uint32_t systime_t
System time.
Definition os_port_none.h:90
Date and time representation.
Definition date_time.h:47