Go to the documentation of this file.
39 static const char days[8][10] =
52 static const char months[13][10] =
82 uint16_t milliseconds;
86 milliseconds =
time % 1000;
104 osSprintf(str,
"%" PRIu16
"h %02" PRIu8
"min %02" PRIu8
"s %03" PRIu16
"ms",
105 hours, minutes, seconds, milliseconds);
109 osSprintf(str,
"%" PRIu8
"min %02" PRIu8
"s %03" PRIu16
"ms",
110 minutes, seconds, milliseconds);
114 osSprintf(str,
"%" PRIu8
"s %03" PRIu16
"ms", seconds, milliseconds);
118 osSprintf(str,
"%" PRIu16
"ms", milliseconds);
144 osSprintf(str,
"%s, %s %" PRIu8
", %" PRIu16
" %02" PRIu8
":%02" PRIu8
":%02" PRIu8,
150 osSprintf(str,
"%s %" PRIu8
", %" PRIu16
" %02" PRIu8
":%02" PRIu8
":%02" PRIu8,
225 a = (uint32_t) ((4 *
t + 102032) / 146097 + 15);
226 b = (uint32_t) (
t + 2442113 +
a - (
a / 4));
227 c = (20 *
b - 2442) / 7305;
228 d =
b - 365 *
c - (
c / 4);
229 e = d * 1000 / 30601;
230 f = d - e * 30 - e * 601 / 1000;
282 t = (365 * y) + (y / 4) - (y / 100) + (y / 400);
284 t += (30 *
m) + (3 * (
m + 1) / 5) + d;
325 else if(date1->
day < date2->
day)
329 else if(date1->
day > date2->
day)
402 h = d + (26 * (
m + 1) / 10) + k + (k / 4) + (5 * j) + (j / 4);
405 return ((
h + 5) % 7) + 1;
Date and time management.
time_t convertDateToUnixTime(const DateTime *date)
Convert date to Unix timestamp.
void convertUnixTimeToDate(time_t t, DateTime *date)
Convert Unix timestamp to date.
uint8_t computeDayOfWeek(uint16_t y, uint8_t m, uint8_t d)
Calculate day of week.
const char_t * formatSystemTime(systime_t time, char_t *str)
Format system time.
#define osSprintf(dest,...)
void getCurrentDate(DateTime *date)
Get current date and time.
const char_t * formatDate(const DateTime *date, char_t *str)
Format date.
Date and time representation.
uint32_t systime_t
System time.
__weak_func time_t getCurrentUnixTime(void)
Get current time.
int_t compareDateTime(const DateTime *date1, const DateTime *date2)
Compare dates.