mktime()
defaults each parameter as the current date/time. So it looks like your $_POST
values aren't being set as expected, are empty, or are the wrong type.
According to Converting to integer you shouldn't need to explicitly cast at all, as the function expects int
s anyhow. But doing the explicit cast or conversion will allow you to check if that is actually working prior to relying on the function call to do it for you (and in this case, possibly fail to do so).
You're using (int)
to cast... What about using intval()
instead or in addition, and then test/print
the input values before your conversion, and then again after (before mktime()
).
I expect you'll find they're not as expected, and if so, that your explicit casts are also failing.