cvs: /php3/functions parsedate.y

From: Date: Mon, 12 Jul 1999 12:46:05 +0000
Subject: cvs: /php3/functions parsedate.y
Groups: php.dev 
Request: Send a blank email to php-dev+get-8395@lists.php.net to get a copy of this message
andrey Mon Jul 12 12:46:05 1999 EDT Modified files: /php3/functions parsedate.y Log: Fixes. Index: php3/functions/parsedate.y diff -u php3/functions/parsedate.y:1.1 php3/functions/parsedate.y:1.2 --- php3/functions/parsedate.y:1.1 Mon Jul 12 11:56:30 1999 +++ php3/functions/parsedate.y Mon Jul 12 12:46:04 1999 @@ -213,6 +213,12 @@ extern struct tm *localtime(); +#ifndef HAVE_TM_ZONE +#ifndef _TIMEZONE +extern time_t timezone; +#endif +#endif + time_t dateconv(mm, dd, yy, h, m, s, mer, zone, dayflag) int mm, dd, yy, h, m, s, mer, zone, dayflag; @@ -228,7 +234,7 @@ if (yy < epoch || yy > 2099 || mm < 1 || mm > 12 || dd < 1 || dd > mdays[--mm]) return (-1); jdate = dd-1; - for (i=0; i<mm; i++) jdate += mdays[i]; + for (i=0; i<mm; i++) jdate += mdays[i]; for (i = epoch; i < yy; i++) jdate += 365 + (i%4 == 0); jdate *= daysec; jdate += zone * 60L; @@ -545,12 +551,11 @@ int err; struct tm *lt; struct timeval ftz; - struct timezone zon; time_t sdate, tod; lptr = p; - gettimeofday(&ftz,&zon); + gettimeofday(&ftz, NULL); if (now == ((struct timeval *) NULL)) { now = &ftz; } @@ -560,7 +565,11 @@ day = lt->tm_mday; relsec = 0; relmonth = 0; timeflag=zoneflag=dateflag=dayflag=relflag=0; - ourzone = zon.tz_minuteswest; +#ifdef HAVE_TM_GMTOFF + ourzone = lt->tm_gmtoff/60; +#else + ourzone = timezone/60; +#endif daylight = MAYBE; hh = mm = ss = 0; merid = 24;

« previous php.dev (#8395) next »