myMPD
Internal API documentation
Loading...
Searching...
No Matches
datetime.c File Reference

Date and time functions. More...

#include "compile_time.h"
#include "src/lib/datetime.h"
#include "src/lib/log.h"
#include <string.h>
Include dependency graph for datetime.c:

Functions

time_t parse_date (const char *str)
 
void readable_time (char *buf, time_t timestamp)
 

Detailed Description

Date and time functions.

Function Documentation

◆ parse_date()

time_t parse_date ( const char *  str)

Parses a YYYY-MM-DD string to a unix timestamp

Parameters
strstring to parse
Returns
time_t unix timestamp

◆ readable_time()

void readable_time ( char *  buf,
time_t  timestamp 
)

Appends a formatted time to the buffer

Parameters
bufalready allocated sds string
timestamptimestamp to display