I've tired to add 10 weekdays to now. Everything is OK, but it clears the time part. Do you know why?
$now = date("Y-m-d H:i:s");
echo $now.'<br>';
$mod = strtotime($now." +10 weekdays");
echo $mod.'<br>';
echo date("Y-m-d H:i:s",$mod).'<br>';
Output:
2011-05-23 14:34:02
1307311200
2011-06-06 00:00:00
My expected output were:
2011-06-06 14:34:02
Thanks.
Looks like a difference in interpretation.
You could do the following to enforce the time:
<?php
$date = date("Y-m-d");
$time = date("H:i:s");
echo $date.' '.$time.'<br>';
$mod= strtotime($date." +10 weekdays $time");
echo $mod.'<br>';
echo date("Y-m-d H:i:s",$mod).'<br>';
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