|
Posted by Pedro Graca on 01/20/06 14:17
Steel wrote:
>
> $FileName="myfile.txt";
> $Today =strtotime('2006-01-20 00:00:00');
> touch($FileName,$Today)
>
>
> It work
>
> Now I want to add 24hours to the new last modified date without to know any
> time what is the date but knowing that the last modified date must be always
> have the time set to 00:00:00
Hmmm ... what date do you want a file last modified on
2006-01-20 00:00:01
changed to?
What if is has been last modified on
2006-01-20 23:59:59
> I.e.:
> How can I do?
clearstatcache();
$origtime = getdate(filemtime($FileName));
$newtime = mktime(0, 0, 0, $origtime['mon'], 1+$origtime['mday'], $origtime['year']);
### answer the questions above and either uncomment or remove the
### following line
// $newtime += 24*60*60;
touch($FileName, $newtime);
You may have some problems when DST starts/ends. Perhaps you can use
gmmktime() instead.
--
If you're posting through Google read <http://cfaj.freeshell.org/google>
Navigation:
[Reply to this message]
|