We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 397c9eb commit 5933d52Copy full SHA for 5933d52
pgut/pgut.c
@@ -497,6 +497,7 @@ parse_time(const char *value, time_t *time)
497
tmp[len] = '\0';
498
499
/* parse for "YYYY-MM-DD HH:MI:SS" */
500
+ memset(&tm, 0, sizeof(tm));
501
tm.tm_year = 0; /* tm_year is year - 1900 */
502
tm.tm_mon = 0; /* tm_mon is 0 - 11 */
503
tm.tm_mday = 1; /* tm_mday is 1 - 31 */
@@ -521,6 +522,9 @@ parse_time(const char *value, time_t *time)
521
522
if (i > 1)
523
tm.tm_mon -= 1;
524
525
+ /* determine whether Daylight Saving Time is in effect */
526
+ tm.tm_isdst = -1;
527
+
528
*time = mktime(&tm);
529
530
return true;
0 commit comments