Solved

PHP Date calculation

Posted on 2007-11-20
2
913 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

688 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