Page 1 of 1

Finding Yesterday

Posted: Tue Oct 23, 2007 3:57 pm
by jstorm13
Hello:

I have a batch file in PHP I want to run once per day. The batch file is called by another file.

This other file creates a new day file, filename below and then runs the batch file.

Todays Filename: 20071023 (this is the format i use for the file name)

The batch file when ran would take 20071022 and do something with it.

What is the most efficient way of finding out yesterdays file name?

Any help with this question is appreciated. Thanks in advance.

Jason

P.S. I am using a linux server for php code.

Posted: Tue Oct 23, 2007 4:06 pm
by John Cartwright

Code: Select all

$filename = date('Ymd', strtotime('yesterday'));
:wink:

Thanks

Posted: Tue Oct 23, 2007 4:12 pm
by jstorm13
I thought there was a good one line command out there, but was not sure what it was.

THANK YOU....

Jason