Finding Yesterday

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jstorm13
Forum Newbie
Posts: 12
Joined: Wed Oct 10, 2007 12:40 pm

Finding Yesterday

Post 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.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Code: Select all

$filename = date('Ymd', strtotime('yesterday'));
:wink:
jstorm13
Forum Newbie
Posts: 12
Joined: Wed Oct 10, 2007 12:40 pm

Thanks

Post by jstorm13 »

I thought there was a good one line command out there, but was not sure what it was.

THANK YOU....

Jason
Post Reply