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;



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to