Solved

PHP Date calculation

Posted on 2007-11-20
2
909 Views
Last Modified: 2008-02-01
Hi!
I'd need a simple php function to calculate the date.
I need to display the field if it has today's date OR minus one, meaning also if it was created yesterday.
I have:
$today = date("Y-m-d",time());

Thanks!
0
Comment
Question by:Frossard
  • 2
2 Comments
 
LVL 20

Accepted Solution

by:
steelseth12 earned 250 total points
ID: 20320945
$today = date("Y-m-d"); // today
$yesterday = date("Y-m-d",strtotime("-1 day")); // yesterday
0
 
LVL 20

Expert Comment

by:steelseth12
ID: 20320947
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
php construct 5 25
Insert won't work due to space in column name 5 20
ebay devID, appID, certID, userToken 2 25
website maintenance mode 1 17
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question