E
E
entermix2015-08-05 17:31:21
PHP
entermix, 2015-08-05 17:31:21

Why is the strftime function not working correctly?

Why function:

echo (strftime('%e', strtotime('first day of next month')));

Returns one (with a space before it) ?
Like this:
echo (strftime('%m', strtotime('first day of next month')))

Everything works correctly, but the month number is returned in this format: 01, 02 .., but you need 1.2 ..

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Tarakhonich, 2015-08-05
@entermix

%e - DAY of the month, with a LEADING SPACE if it is a single digit.
%m - TWO DIGITAL serial number of the MONTH
php.net/strftime

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question