Adding working days - cleans up time

I'm tired of adding 10 weekdays. Everything is in order, but it cleans the temporary 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>';

Conclusion:

2011-05-23 14:34:02
1307311200
2011-06-06 00:00:00

My expected result:

 2011-06-06 14:34:02

Thank.

+3
source share
2 answers

Looks like a difference in interpretation.

You can do the following to ensure 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>';
+4
source

All Articles