#ifndef __RTCtime_H
#define __RTCtime_H
#include "main.h"
#include "stdint.h"

typedef struct rtc_time_struct
{
    uint16_t ui8Year;       // 1970~2038
    uint8_t ui8Month;       // 1~12
    uint8_t ui8DayOfMonth;  // 1~31
    uint8_t ui8Week;
    uint8_t ui8Hour;        // 0~23
    uint8_t ui8Minute;      // 0~59
    uint8_t ui8Second;      // 0~59
   
}rtc_time_t;

time_t parse_cclk_time(const char *buffer);
time_t Parse_WIFI_Time_To_Epoch(const char *response);
uint8_t isLeapYear(uint16_t year);
void covUnixTimeStp2Beijing(uint32_t unixTime, rtc_time_t *tempBeijing);
uint32_t covBeijing2UnixTimeStp(rtc_time_t *beijingTime);
void Set_RTC_Time(time_t epoch_time);
time_t Get_RTC_Time(void);
void printCurrentRTCTime(void);

#endif /*__RTCtime_H*/
