Instantly share code, notes, and snippets.

Embed
What would you like to do?
#include <time.h>
struct tm *gmtime(const time_t *calptr);
struct tm *localtime(const time_t *calptr);
/* Both return: pointer to broken-down time, NULL on error */
#include <time.h>
time_t mktime(struct tm *tmptr);
Returns: calendar time if OK, −1 on error
#include <time.h>
size_t strftime(char *restrict buf, size_t maxsize,
const char *restrict format,
const struct tm *restrict tmptr);
size_t strftime_l(char *restrict buf, size_t maxsize,
const char *restrict format,
const struct tm *restrict tmptr, locale_t locale);
/* Both return: number of characters stored in array if room, 0 otherwise */
#include <time.h>
char *strptime(const char *restrict buf, const char *restrict format,
struct tm *restrict tmptr);
/* Returns: pointer to one character past last character parsed, NULL otherwise */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment