CVS update: php3/functions

From: Date: Mon, 07 Jun 1999 21:16:18 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-6684@lists.php.net to get a copy of this message
Date: Monday June 7, 1999 @ 17:16 Author: cmv Update of /repository/php3/functions In directory php:/tmp/cvs-serv6718/functions Modified Files: datetime.c Log Message: Fixed function to correspond to the docs Index: php3/functions/datetime.c diff -u php3/functions/datetime.c:1.57 php3/functions/datetime.c:1.58 --- php3/functions/datetime.c:1.57 Mon Jun 7 17:01:26 1999 +++ php3/functions/datetime.c Mon Jun 7 17:16:17 1999 @@ -30,7 +30,7 @@ */ -/* $Id: datetime.c,v 1.57 1999/06/07 21:01:26 andrey Exp $ */ +/* $Id: datetime.c,v 1.58 1999/06/07 21:16:17 cmv Exp $ */ #ifdef THREAD_SAFE @@ -315,6 +315,7 @@ break; case 'F': /* month, textual, full */ case 'l': /* day (of the week), textual */ + case 'T': /* timezone name */ size += 9; break; case 'Z': /* timezone offset in seconds */ @@ -325,7 +326,7 @@ break; case 'M': /* month, textual, 3 letters */ case 'D': /* day, textual, 3 letters */ - case 'z': /* day of the year */ + case 'z': /* day of the year, 1 to 366*/ size += 3; break; case 'y': /* year, numeric, 2 digits */ @@ -390,7 +391,7 @@ strcat(return_value->value.str.val, day_short_names[ta->tm_wday]); break; case 'z': /* day (of the year) */ - sprintf(tmp_buff, "%d", ta->tm_yday); /* SAFE */ + sprintf(tmp_buff, "%d", ta->tm_yday + 1); /* SAFE */ strcat(return_value->value.str.val, tmp_buff); break; case 'y': /* year, numeric, 2 digits */ @@ -484,6 +485,9 @@ case 'L': /* boolean for leapyear */ sprintf(tmp_buff, "%d", (isleap((ta->tm_year+1900)) ? 1 : 0 ) ); strcat(return_value->value.str.val, tmp_buff); + break; + case 'T': /* timezone name */ + strcat(return_value->value.str.val, ta->tm_zone); break; default: length = strlen(return_value->value.str.val);

« previous php.dev (#6684) next »