How do I modify the code below to work with hours instead of days:
function isViewableDate($current_date, $min_notice, $max_notice) {
$min_days = -3; //ideally I would like $min_hours = -75;
$min_date = mktime(0,0,0, date('m'), date('d') + $min_days);
if ($current_date > $min_date)
{
return true;
}
if ($current_date < $min_date)
{
return false;
}
Thanks!
Alison
Quick Newbie Question about dates...
Moderator: General Moderators
Re: Quick Newbie Question about dates...
Not sure what you're trying to do here, maybe I'm just being noob too. But I believe mktime returns the seconds since 1970 so if you wanted hours, couldn't you just multiply it by 3600? Again, not quite sure what you want.
Re: Quick Newbie Question about dates...
Hi,
I would like the function to be "true" when todays date falls within 75 hours ago (not 3 days ago as it is now). And the function to be "false" if todays dates is past 75 hours ago.
Thanks for your reply
Alison
I would like the function to be "true" when todays date falls within 75 hours ago (not 3 days ago as it is now). And the function to be "false" if todays dates is past 75 hours ago.
Thanks for your reply
Alison
Re: Quick Newbie Question about dates...
Thanks, I figured it out with the help of that tutorial!!!
Alison
Alison