/ Published in: C
Expand |
Embed | Plain Text
#include<time.h> #include<stdio.h> #include <stdlib.h> #include <string.h> /* can be called in shell with: shell$ TZ="Europe/Rome" ./teste */ int main(int argc, char *argv[]) { time_t now_time; struct tm *now; // Forcing timezone //setenv("TZ", "Europe/Rome", 1); //tzset(); time(&now_time); now = localtime(&now_time); return 0; }
Comments
Subscribe to comments
You need to login to post a comment.

Linux gcc