cvs: php4 /ext/standard microtime.c
| From: | Ilia Alshanetsky | Date: | Mon, 19 Aug 2002 21:59:46 +0000 |
| Subject: | cvs: php4 /ext/standard microtime.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-13476@lists.php.net to get a copy of this message | ||
iliaa Mon Aug 19 17:59:46 2002 EDT
Modified files:
/php4/ext/standard microtime.c
Log:
Convert the value of tz_minuteswest inside struct timezone on Windows to
minutes from seconds.
Index: php4/ext/standard/microtime.c
diff -u php4/ext/standard/microtime.c:1.36 php4/ext/standard/microtime.c:1.37
--- php4/ext/standard/microtime.c:1.36 Thu Feb 28 03:26:46 2002
+++ php4/ext/standard/microtime.c Mon Aug 19 17:59:46 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: microtime.c,v 1.36 2002/02/28 08:26:46 sebastian Exp $ */
+/* $Id: microtime.c,v 1.37 2002/08/19 21:59:46 iliaa Exp $ */
#include "php.h"
@@ -43,6 +43,7 @@
#define NUL '\0'
#define MICRO_IN_SEC 1000000.00
+#define SEC_IN_MIN 60
/* {{{ proto string microtime(void)
Returns a string containing the current time in seconds and microseconds */
@@ -81,7 +82,11 @@
array_init(return_value);
add_assoc_long(return_value, "sec", tp.tv_sec);
add_assoc_long(return_value, "usec", tp.tv_usec);
+#ifdef PHP_WIN32
+ add_assoc_long(return_value, "minuteswest", tz.tz_minuteswest/SEC_IN_MIN);
+#else
add_assoc_long(return_value, "minuteswest", tz.tz_minuteswest);
+#endif
add_assoc_long(return_value, "dsttime", tz.tz_dsttime);
return;
} else