Skip to content

Commit

Permalink
Fix random hour of time shift.
Browse files Browse the repository at this point in the history
What appeared to be a random daylight savings time issue, was a failure to zero out a struct tm.  Appears to be fixed.
  • Loading branch information
topher800 committed Sep 19, 2024
1 parent f63e20d commit 135feea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions dataIO.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,9 +897,8 @@ void GetTimeInterval(int InputFile, DATAFILE_INFO *curFile, int timeVarID, size_
if (getNCattr(InputFile, timeVarID, "strptime_format", format) == false)
format = "seconds since %F %T %z";

memset(&stm, 0, sizeof(struct tm));
strptime(units.c_str(), format.c_str(), &stm);
setenv("TZ", "", 1);
tzset();
time_t start = mktime(&stm) + first - timezone;
time_t end = mktime(&stm) + last - timezone;

Expand Down
2 changes: 1 addition & 1 deletion fbr.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static String fallback_resources[] =
"*XmTextField.foreground: black",
"*XmForm.horizontalSpacing: 4",
"*XmForm.verticalSpacing: 4",
"*topLevelShell.title: ncplot 4.11.4",
"*topLevelShell.title: ncplot 4.12.0",
"*topLevelShell.iconName: ncplot",
"*topLevelShell.allowShellResize: True",
"*topLevelShell.x: 50",
Expand Down

0 comments on commit 135feea

Please sign in to comment.