I am currently doing a website which offers delivery Monday through Friday only.
I am trying to figure out how to add delivery date. For e.g:
"Order today and you can expect delivery on DD/MM/YY"
The above date would require to exclude any weekends
So basically if ordered today the delivery day is 4 working days later excluding weekends.
Try this:
<?php
echo strftime("%e/%m/%y", strtotime("+4 weekday"))
?>
It creates a time string "4 weekdays from now" formatted as DD/MM/YY.
The relative formats for dates that can be used with strtotime are explained here: http://php.net/manual/en/datetime.formats.relative.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With