Microchip® Advanced Software Framework

calendar.h File Reference

Calendar.

Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.

#include <stdint.h>
#include <stdbool.h>

Data Structures

struct  calendar_date
 Calendar structure to hold a date. More...
 

Functions

void calendar_add_second_to_date (struct calendar_date *date)
 Increments a date with one second. More...
 
uint32_t calendar_date_to_timestamp (struct calendar_date *date)
 Convert a date to a UNIX timestamp. More...
 
uint32_t calendar_date_to_timestamp_tz (struct calendar_date *date, int8_t hour, uint8_t min)
 This function converts a date in a given time zone to a UNIX timestamp. More...
 
bool calendar_is_date_valid (struct calendar_date *date)
 Check if a date is valid. More...
 
void calendar_time_between_dates (struct calendar_date *date_end, struct calendar_date *date_start, struct calendar_date *date_out)
 This function calculates the time difference between to dates. More...
 
void calendar_timestamp_to_date (uint32_t timestamp, struct calendar_date *date_out)
 Convert a UNIX timestamp to a date. More...
 
void calendar_timestamp_to_date_tz (uint32_t timestamp, int8_t hour, uint8_t min, struct calendar_date *date_out)
 Convert a UNIX timestamp to a date in a given time zone. More...