So I've needed to create a script that will show tomorrows date, with the exception of Friday, Saturday and Sunday as I would like to show that option as Monday and a countdown timer that expires at 2PM every day.
So far I have:
- Code: Select all
<?php date_default_timezone_set('America/New_York'); ?>
<?php echo $this->__('Order in the next ') ?>
$today = strtotime('today 14:00');
$tomorrow = strtotime('tomorrow 14:00');
$now = time();
$timeLeft = ($now > $today ? $tomorrow : $today) - $now;
printf("%s\n", gmdate("H:i", $timeLeft));?>
<?php echo $this->__('and receive your order ') ?><?php $date = date("d-M-y", strtotime("tomorrow")); echo $date; ?>
Perfect, but how would I throw in the Friday, Saturday, Sunday variables?
Also is it possible to display the date written out example: Monday, October 21 ?