Solved

PHP Date calculation

Posted on 2007-11-20
2
911 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 …
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to dynamically set the form action using jQuery.
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 …

679 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