Created
February 11, 2017 23:11
-
-
Save chuckremes/698b0ee5d1279374cb1ef3add82a6f18 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <time.h> | |
#include <string.h> | |
#include <errno.h> | |
#define LOGGER_TIME_SIZE 16 | |
int main() { | |
time_t clock; | |
struct tm lt; | |
char formatted_time_[LOGGER_TIME_SIZE]; | |
time(&clock); | |
localtime_r(&clock, <); | |
strftime(formatted_time_, LOGGER_TIME_SIZE, "%b %e %H:%M:%S", <); | |
return errno; // returns EINVAL, 22 which is set by strftime | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment