R
R
Robot2015-11-20 19:38:30
PHP
Robot, 2015-11-20 19:38:30

Where is the error in working with the date?

From the date() documentation php.net/manual/en/function.date.php

t - Number of days in the specified month from 28 to 31

Then:
$Tooday = date("Y-m-d"); // 2015-11-20
$ToodayMonth = date("n"); // 11
$AllDayMonth = date("t", $ToodayMonth); // 31

wtf? Why does November show 31 days?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2015-11-20
@iam_not_a_robot

Because 1970-01-01 00:00:11 is January 1970 and has 31 days.

$AllDayMonth = date("t", $ToodayMonth);
$AllDayMonth = date("t", 11);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question