Re: Problem on Date Function
| From: | George Nicolae | Date: | Tue, 03 Jun 2003 12:07:00 +0000 |
| Subject: | Re: Problem on Date Function | ||
| References: | 1 | Groups: | php.general php.windows |
| Request: | Send a blank email to php-windows+get-20170@lists.php.net to get a copy of this message | ||
$date1="2003-06-02";
$date2=date("Y-m-d",strtotime($date1)-3*24*60*60);
echo $date2;
--
Best regards,
George Nicolae
IT Manager
___________________
PaginiWeb.com - Professional Web Design
www.PaginiWeb.com
"Jack" <nedcor4@nedcor.com.hk> wrote in message
news:20030603094058.12746.qmail@pb1.pair.com...
> Dear all
> Here is the situation :
>
> Our automation system will generate a large number of pdf file to a
specific
> folder every day. The name format for all these pdf file is
> "xxxx.20030602.pdf".
> xxxx is the name of the file,
> 20030602 is last working date.
>
>
> what i want to do is:
> 1. create a sub-folder inside this specific folder, and name it to current
> month(Jun-2003)
> 2. move the pdf which is not containning last working's file name to this
> new create sub-folder.
> 3. the files with last working date's name will stay on the specific
folder.
>
> question :
>
> 1. I had used a date function with "w" parameter to check if current date
i
> execute the script is monday (1), if so , i tell the script to take the
> current date minus 3, so the date will become last friday (as our last
> working day), then i can base on this date to tell the script which files
> should not be move to sub-folder!
>
> q: how i can do a date subtraction in php? (eg. "2003-06-02" - 3 =
> "2003-05-30")
>
>