PHP date(): minutes without leading zeros

后端 未结 15 1499
粉色の甜心
粉色の甜心 2020-12-13 23:17

I\'d like to know if there is a formatting letter for PHP\'s date() that allows me to print minutes without leading zeros, or whether I have to manuall

15条回答
  •  时光取名叫无心
    2020-12-13 23:50

    I tried to find this for seconds as well, gave up the search and just casting the result as a int like this:

    echo (int)date("s");
    

    That will get rid of the leading zero's in a fast efficient way.

提交回复
热议问题