Hi all,
I have a small script that depending on the time and day; I would like it to output different things:
<?php
$currenttime = ((date("H")+7). ":" .date("i"));
if ($currenttime >= "16:30") {
$tomorrow = mktime(0, 0, 0, date("m") , date("d")+2, date("Y"));
$jsdate = (date("Y"). "-" .date("m"). "-" .(date("d")+1). "-16-30");
}
else{
$tomorrow = mktime(0, 0, 0, date("m") , date("d")+1, date("Y"));
$jsdate = (date("Y"). "-" .date("m"). "-" .date("d"). "-16-30");
}
echo " Time left for delivery on <b><center>" .date("l \\t\h\e jS F", $tomorrow). "</b>:</center>";
?>
<center>
<script>
// deadline(date, width, height, style, background, number color, small text color);
deadline("<? echo $jsdate; ?>", "220", "37", "digital2", "#FFFFFF", "#000099", "#000000");
</script>
</center>
For instance on a Monday before 16:30 it would need the following:
- Time left for delivery on Tuesday the {date} of {month}
- Then display how long left until 16:30 in DD HH MM SS format(Preferable to be servertime rather than users local time.)
Then after 16:30 on a Monday it would need to read:
- Time left for delivery on Wednesday the {date} of {month}
- Then display how long left until 16:30 in DD HH MM SS format(Preferable to be servertime rather than users local time.)
Then from 16:30 on Thursday until Monday 16:30 it would need to read:
- Time left for delivery on Tuesday the {date} of {month}
- Then display how long left until 16:30 in DD HH MM SS format(Preferable to be servertime rather than users local time.)
I hope this all make sense and thanks for looking.
Ta, B.