You've already forked pg_probackup
mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-09-16 09:26:30 +02:00
Determine whether Daylight Saving Time is in effect when parse time.
git-svn-id: http://pg-rman.googlecode.com/svn/trunk@34 182aca00-e38e-11de-a668-6fd11605f5ce
This commit is contained in:
@@ -497,6 +497,7 @@ parse_time(const char *value, time_t *time)
|
|||||||
tmp[len] = '\0';
|
tmp[len] = '\0';
|
||||||
|
|
||||||
/* parse for "YYYY-MM-DD HH:MI:SS" */
|
/* parse for "YYYY-MM-DD HH:MI:SS" */
|
||||||
|
memset(&tm, 0, sizeof(tm));
|
||||||
tm.tm_year = 0; /* tm_year is year - 1900 */
|
tm.tm_year = 0; /* tm_year is year - 1900 */
|
||||||
tm.tm_mon = 0; /* tm_mon is 0 - 11 */
|
tm.tm_mon = 0; /* tm_mon is 0 - 11 */
|
||||||
tm.tm_mday = 1; /* tm_mday is 1 - 31 */
|
tm.tm_mday = 1; /* tm_mday is 1 - 31 */
|
||||||
@@ -521,6 +522,9 @@ parse_time(const char *value, time_t *time)
|
|||||||
if (i > 1)
|
if (i > 1)
|
||||||
tm.tm_mon -= 1;
|
tm.tm_mon -= 1;
|
||||||
|
|
||||||
|
/* determine whether Daylight Saving Time is in effect */
|
||||||
|
tm.tm_isdst = -1;
|
||||||
|
|
||||||
*time = mktime(&tm);
|
*time = mktime(&tm);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user