Req #61987 [Com]: abbreviate "Y-m-d H:i:s" to Q
Edit report at https://bugs.php.net/bug.php?id=61987&edit=1
ID: 61987
Comment by: joergybehrens at gmail dot com
Reported by: mark at skimbl dot com
Summary: abbreviate "Y-m-d H:i:s" to Q
Status: Open
Type: Feature/Change Request
Package: Date/time related
Operating System: N/A
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Hi mark: You could add the function by yourself. Boz the new feature could affect
other parameter of Data() function. And the patch you could try for your own
version PHP.
Previous Comments:
------------------------------------------------------------------------
[2012-05-10 04:51:04] mark at skimbl dot com
Description:
------------
---
From manual page: http://www.php.net/function.date
---
Is there any chance the common Y-m-d H:i:s can be summarized as "Q" for the common MySQL
datetime format. I have written this sequence hundreds of times (You're the man now dog, Hamlet
in space?)
Seeing as MySQL and PHP are so commonly tied together I think this could be a very useful shortcut
to add.
http://stackoverflow.com/search?q=Y-m-d+H%3Ai%3As
over 5.000 related issues
https://www.google.com/search?q=%22Y-m-d+H%3Ai%3As%22
over 1.7 million results
Easier and quicker to memorize.
Test script:
---------------
<?php
echo date('Q'); // Prints Q
Expected result:
----------------
2012-05-10 12:00:00
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61987&edit=1
Thread (4 messages)