php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #77393
Patch seconds-without-leading-zeros revision 2019-01-03 16:05 UTC by lagodichyuriy at gmail dot com

Patch seconds-without-leading-zeros for Date/time related Bug #77393

Patch version 2019-01-03 16:05 UTC

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

Developer: lagodichyuriy@gmail.com

--- php_date.c	2019-01-03 10:59:59.234443788 -0500
+++ php_date_v2.c	2019-01-03 11:03:11.767771990 -0500
@@ -1180,6 +1180,7 @@
 			case 'H': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->h); break;
 			case 'i': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->i); break;
 			case 's': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->s); break;
+			case 'q': length = slprintf(buffer, sizeof(buffer), "%d",   (int) t->s); break;
 			case 'u': length = slprintf(buffer, sizeof(buffer), "%06d", (int) floor(t->us)); break;
 			case 'v': length = slprintf(buffer, sizeof(buffer), "%03d", (int) floor(t->us / 1000)); break;
 
@@ -1376,6 +1377,7 @@
 		case 'H': case 'G': retval = (int) t->h; break;
 		case 'i': retval = (int) t->i; break;
 		case 's': retval = (int) t->s; break;
+		case 'q': retval = (int) t->s; break;
 
 		/* timezone */
 		case 'I': retval = (int) (!localtime ? offset->is_dst : 0); break;
@@ -4476,6 +4478,7 @@
 
 				case 'S': length = slprintf(buffer, sizeof(buffer), "%02" ZEND_LONG_FMT_SPEC, (zend_long) t->s); break;
 				case 's': length = slprintf(buffer, sizeof(buffer), ZEND_LONG_FMT, (zend_long) t->s); break;
+				case 'q': length = slprintf(buffer, sizeof(buffer), ZEND_LONG_FMT, (zend_long) t->s); break;
 
 				case 'F': length = slprintf(buffer, sizeof(buffer), "%06" ZEND_LONG_FMT_SPEC, (zend_long) t->us); break;
 				case 'f': length = slprintf(buffer, sizeof(buffer), ZEND_LONG_FMT, (zend_long) t->us); break;
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Jun 16 05:01:26 2019 UTC