PHP date(): minutes without leading zeros

后端 未结 15 1526
粉色の甜心
粉色の甜心 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-14 00:09

    use PHP's absolute value function:

    abs( '09' ); // result = 9

    abs( date( 'i' ) ); // result = minutes without leading zero

提交回复
热议问题