Created
February 8, 2019 16:02
-
-
Save geo-stanciu/cffdf39d6286aacd5e7f75dcbd752955 to your computer and use it in GitHub Desktop.
c - get current locat time
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> | |
time_t rawtime; | |
struct tm * timeinfo; | |
time(&rawtime); | |
timeinfo = localtime(&rawtime); | |
setlocale(LC_ALL, "C"); | |
strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", now); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment