php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #77393 Seconds without leading zero
Submitted: 2019-01-01 19:04 UTC Modified: 2022-05-13 16:05 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: jed_keenan at hotmail dot com Assigned:
Status: Wont fix Package: Date/time related
PHP Version: Irrelevant OS: W10
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2019-01-01 19:04 UTC] jed_keenan at hotmail dot com
Description:
------------
---
From manual page: https://php.net/function.date
---

Any chance of having Seconds without leading zero to go with Hours [%k] and Minutes [%l]? Maybe %q?

Expected result:
----------------
%q = Seconds without leading 0 :)


Patches

seconds-without-leading-zeros (last revision 2019-01-03 16:05 UTC by lagodichyuriy at gmail dot com)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-01-01 19:57 UTC] cmb@php.net
-Package: Output Control +Package: Date/time related
 [2019-01-03 16:07 UTC] lagodichyuriy at gmail dot com
I've just attached sample patch. I'm not very smart in C and don't really believe that this feature will be confirmed, but it looks quite simple to "fix".
 [2022-05-13 16:05 UTC] derick@php.net
-Status: Open +Status: Wont fix
 [2022-05-13 16:05 UTC] derick@php.net
I don't think we should add this. There is almost no need for formatting a time without leading zeros for seconds. If you just want to get a number for the seconds, you can use idate('s') instead.

The date() function also does not support minutes without leading zeroes ('l' is for day names) and I don't know where you get 'k' from.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 06:01:30 2024 UTC