0

How to check if a previously stored time() value is today in php?

I have a xml stored with a timestamp generated from time() in php. I would like to use php to check if the date of the timestamp is today. Whats the best way to do this? I'm very confused on the format of PHP date/time functions. Thanks!

3
  • possible duplicate of Check if timestamp is today Commented Apr 7, 2014 at 15:39
  • Convert the stored timestamp and the current timestamp to dates, and check if they match? Commented Apr 7, 2014 at 15:39
  • 2
    Basically date('Ymd') === date('Ymd', $timestamp). Commented Apr 7, 2014 at 15:40

1 Answer 1

0

Use this

$timestamp = yourprevioustimestamp; if(date('Ymd') == date('Ymd', $timestamp)){ //if it's equal... } else{ //if it is not... } 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.