Skip to content

Instantly share code, notes, and snippets.

@ncopa
Created May 7, 2014 11:50
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 ncopa/b5109e93658a6c1dd20b to your computer and use it in GitHub Desktop.
Save ncopa/b5109e93658a6c1dd20b to your computer and use it in GitHub Desktop.
/*
* Run in UTC timezone, on the off-chance that this operating
* system does not have a timegm() function, and translates
* timestamps on the local timescale.
* See lib/libvarnish/time.c
*/
AZ(setenv("TZ", "UTC", 1));
tzset();
assert(VTIM_parse("Sun, 06 Nov 1994 08:49:37 GMT") == 784111777);
assert(VTIM_parse("Sunday, 06-Nov-94 08:49:37 GMT") == 784111777);
assert(VTIM_parse("Sun Nov 6 08:49:37 1994") == 784111777);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment