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 manually test for and remove leading zeros?
Use:
$minutes = intval(date('i'));
For times with more information than just minutes:
ltrim()
- Strip whitespace (or other characters) from the beginning of a string
ltrim(date('i:s'), 0);
returns:
8:24
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With