Solved

PHP Date calculation

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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 …

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now