Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PYTSK_SKIP_TZSET - Environment variable to skip default setting of timezone #99

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tsk3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,9 @@ void tsk_init() {
// libtsk uses mktime and localtime that rely on the TZ environment variable
// however that leads to inconsistent behavior with different TZ values.
// Hence that we force TZ to be UTC, when possible.
// Callers may opt-out of this correction by explicitly setting PYTSK_SKIP_TZSET

if (getenv("PYTSK_SKIP_TZSET") != NULL) {
#if defined( _MSC_VER )
_putenv_s("TZ", "UTC");
_tzset();
Expand All @@ -708,6 +711,7 @@ void tsk_init() {
setenv("TZ", "UTC", 1);
tzset();
#endif
}

//tsk_verbose++;
Img_Info_init((Object)&__Img_Info);
Expand Down