cvs: /php4/ext/standard datetime.c
| From: | Sascha Schumann | Date: | Mon, 31 Jan 2000 17:22:47 +0000 |
| Subject: | cvs: /php4/ext/standard datetime.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-9592@lists.php.net to get a copy of this message | ||
sas Mon Jan 31 18:22:47 2000 EDT
Modified files:
/php4/ext/standard datetime.c
Log:
(PHP mktime) Added windowing support for 0..70
@- mktime interprets years in the range 0-70 now as 2000-2070. You can
@ continue to specify the complete year (i.e. 1920) (Sascha)
Index: php4/ext/standard/datetime.c
diff -u php4/ext/standard/datetime.c:1.28 php4/ext/standard/datetime.c:1.29
--- php4/ext/standard/datetime.c:1.28 Sat Jan 1 21:50:37 2000
+++ php4/ext/standard/datetime.c Mon Jan 31 18:22:17 2000
@@ -19,7 +19,7 @@
*/
-/* $Id: datetime.c,v 1.28 2000/01/01 20:50:37 sas Exp $ */
+/* $Id: datetime.c,v 1.29 2000/01/31 17:22:17 sas Exp $ */
#include "php.h"
@@ -126,9 +126,13 @@
** This function is then Y2K ready, and accepts a wide range of
** dates including the whole gregorian calendar.
** But it cannot represent ancestral dates prior to year 1001.
+ ** Additionally, input parameters of 0..70 are mapped to 100..170
*/
- ta->tm_year = (*arguments[5])->value.lval
- - (((*arguments[5])->value.lval > 1000) ? 1900 : 0);
+ if ((*arguments[5])->value.lval < 70)
+ ta->tm_year = (*arguments[5])->value.lval + 100;
+ else
+ ta->tm_year = (*arguments[5])->value.lval
+ - (((*arguments[5])->value.lval > 1000) ? 1900 : 0);
/* fall-through */
case 5:
ta->tm_mday = (*arguments[4])->value.lval;