@web-font-path: "roboto-debian.css";
v2.2.0 (RP2040)
Loading...
Searching...
No Matches
datetime.h
Go to the documentation of this file.
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _PICO_UTIL_DATETIME_H
#define _PICO_UTIL_DATETIME_H
#include "pico.h"
#ifdef __cplusplus
extern "C" {
#endif
#include <time.h>
#include <sys/time.h>
#if PICO_INCLUDE_RTC_DATETIME
void datetime_to_str(char *buf, uint buf_size, const datetime_t *t);
bool time_to_datetime(time_t time, datetime_t *dt);
bool datetime_to_time(const datetime_t *dt, time_t *time);
void datetime_to_tm(const datetime_t *dt, struct tm *tm);
void tm_to_datetime(const struct tm *tm, datetime_t *dt);
#endif
uint64_t timespec_to_ms(const struct timespec *ts);
uint64_t timespec_to_us(const struct timespec *ts);
void ms_to_timespec(uint64_t ms, struct timespec *ts);
void us_to_timespec(uint64_t ms, struct timespec *ts);
struct tm *pico_localtime_r(const time_t *time, struct tm *tm);
time_t pico_mktime(struct tm *tm);
#ifdef __cplusplus
}
#endif
#endif
pico_mktime
time_t pico_mktime(struct tm *tm)
mktime implementation for use by the pico_util datetime functions
Definition datetime.c:14
pico_localtime_r
struct tm * pico_localtime_r(const time_t *time, struct tm *tm)
localtime_r implementation for use by the pico_util datetime functions
Definition datetime.c:10
pico.h
datetime_t
Structure containing date and time information.
Definition types.h:107