I am able to use the following code to set $filename to the current time:
touch($filename) // SET TO CURRENT DATE/TIME
However, I would like to set $filename to another date, such as April 1, 2002 but cannot seem to get the syntax correct:
touch($filname, "20020104") // DOES NOT WORK
Any help is appreciated.
Problem with touch()
Moderator: General Moderators
Problem with touch()
Unfortunately, that doesn't work either.
Here's code that DOES works:
$filename = "construct.jpg";
if (touch($filename))
{
echo "FILE DATE CHANGED";
}
Here's code that DOES NOT work:
$filename = "construct.jpg";
$time = time();
if (touch($filename,$time))
{
echo "FILE DATE CHANGED";
}
I need to be able to set a filedate to a specific date, but can't even seem to get the above function to work.
Thanks again for any help.
Here's code that DOES works:
$filename = "construct.jpg";
if (touch($filename))
{
echo "FILE DATE CHANGED";
}
Here's code that DOES NOT work:
$filename = "construct.jpg";
$time = time();
if (touch($filename,$time))
{
echo "FILE DATE CHANGED";
}
I need to be able to set a filedate to a specific date, but can't even seem to get the above function to work.
Thanks again for any help.
-
Tubbietoeter
- Forum Contributor
- Posts: 149
- Joined: Fri Mar 14, 2003 2:41 am
- Location: Germany