cvs: php4 /ext/standard datetime.c

From: Date: Wed, 10 Jan 2001 06:48:06 +0000
Subject: cvs: php4 /ext/standard datetime.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-3537@lists.php.net to get a copy of this message
david Tue Jan 9 22:48:06 2001 EDT Modified files: /php4/ext/standard datetime.c Log: fixed swatch internet time (bugs#8242,7106) Index: php4/ext/standard/datetime.c diff -u php4/ext/standard/datetime.c:1.61 php4/ext/standard/datetime.c:1.62 --- php4/ext/standard/datetime.c:1.61 Tue Jan 9 20:01:02 2001 +++ php4/ext/standard/datetime.c Tue Jan 9 22:48:06 2001 @@ -19,7 +19,7 @@ */ -/* $Id: datetime.c,v 1.61 2001/01/10 04:01:02 david Exp $ */ +/* $Id: datetime.c,v 1.62 2001/01/10 06:48:06 david Exp $ */ #include "php.h" @@ -458,7 +458,10 @@ case 'B': /* Swatch Beat a.k.a. Internet Time */ beat = (((((long)the_time)-(((long)the_time) - ((((long)the_time) % 86400) + 3600))) * 10) / 864); - if (beat > 999) beat = 0; + while (beat < 0) { + beat += 1000; + } + beat = beat % 1000; sprintf(tmp_buff, "%03d", beat); /* SAFE */ strcat(return_value->value.str.val, tmp_buff); break;

« previous php.cvs (#3537) next »