Skip to content

Instantly share code, notes, and snippets.

@mjf
Created May 31, 2023 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjf/fa7d2024a604e1b7382bacfe17f4dce6 to your computer and use it in GitHub Desktop.
Save mjf/fa7d2024a604e1b7382bacfe17f4dce6 to your computer and use it in GitHub Desktop.
TZ env var test
cc -o test test.c

Then compare

strace -Ttt ./test

with

TZ=:/etc/localtime strace -Ttt TZ=:/etc/localtime
#include <time.h>
#include <stdio.h>
int
main(int argc, char *argv[])
{
int i = 0;
time_t timep;
printf("Greetings!\n");
for(i = 0; i < 10; i++) {
time(&timep);
localtime(&timep);
}
printf("Bye, bye!\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment