php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #60723
Patch bug60723.patch revision 2012-09-21 03:17 UTC by laruence@php.net

Patch bug60723.patch for Date/time related Bug #60723

Patch version 2012-09-21 03:17 UTC

Return to Bug #60723 | Download this patch
Patch Revisions:

Developer: laruence@php.net

diff --git a/main/main.c b/main/main.c
index 709c6dd..03f8257 100644
--- a/main/main.c
+++ b/main/main.c
@@ -627,7 +627,15 @@ PHPAPI void php_log_err(char *log_message TSRMLS_DC)
 			char *error_time_str;
 
 			time(&error_time);
-			error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 0 TSRMLS_CC);
+#ifdef ZTS
+			if (php_during_module_startup()) {
+				error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 0 TSRMLS_CC);
+			} else {
+				error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 1 TSRMLS_CC);
+			}
+#else
+			error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 1 TSRMLS_CC);
+#endif
 			len = spprintf(&tmp, 0, "[%s] %s%s", error_time_str, log_message, PHP_EOL);
 #ifdef PHP_WIN32
 			php_flock(fd, 2);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 12:01:27 2024 UTC