Re: using getDate on an arbitrary date
| From: | Stefan A. | Date: | Mon, 27 Jan 2020 05:11:17 +0000 |
| Subject: | Re: using getDate on an arbitrary date | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-326987@lists.php.net to get a copy of this message | ||
Probably what you want is something like:
<?php
$time = mktime(0, 0, 0, $month, $day, $year);
if (false !== $time && -1 !== $time) {
$info = getdate($time);
} else {
// error
}
https://www.php.net/manual/en/function.mktime.php
On Mon, Jan 27, 2020 at 5:50 AM Jeffry Killen <jekillen@prodigy.net> wrote:
> Hello;
> What I am looking for is a way to pass a date
> month/day/year to getDate and find out the
> various array values associated with that date.
>
> So the question is: how would I convert int mon/ int day/ int year
> to a time stamp? Looking at the various functions it is not
> clear to me.
>
> Thank you for time and attention;
> JK
>