Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5933d52

Browse files
author
itagaki.takahiro
committed
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
1 parent397c9eb commit5933d52

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

‎pgut/pgut.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ parse_time(const char *value, time_t *time)
497497
tmp[len]='\0';
498498

499499
/* parse for "YYYY-MM-DD HH:MI:SS" */
500+
memset(&tm,0,sizeof(tm));
500501
tm.tm_year=0;/* tm_year is year - 1900 */
501502
tm.tm_mon=0;/* tm_mon is 0 - 11 */
502503
tm.tm_mday=1;/* tm_mday is 1 - 31 */
@@ -521,6 +522,9 @@ parse_time(const char *value, time_t *time)
521522
if (i>1)
522523
tm.tm_mon-=1;
523524

525+
/* determine whether Daylight Saving Time is in effect */
526+
tm.tm_isdst=-1;
527+
524528
*time=mktime(&tm);
525529

526530
return true;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp