strtotime($var);
Turns it into a time value
time() - strtotime($var);
Gives you the seconds since $var
if((time()-(60*60*24)) < strtotime($var))
Will check if $var
has been within the last day.
More Related Contents:
- Display which day it is? sunday or monday “php coding”? [closed]
- Php date() Date and time is stuck [closed]
- PHP 01/01/1970 Issues with Date Fields
- Convert one date format into another in PHP
- Converting string to Date and DateTime
- Correctly determine if date string is a valid date in that format
- PHP DateTime::modify adding and subtracting months
- Adding one day to a date
- Add ‘x’ number of hours to date
- The first day of the current month in php using date_modify as DateTime object
- How to list all months between two dates
- How can I check if the current date/time is past a set date/time?
- Simplest way to increment a date in PHP?
- How to generate random date between two dates using php?
- PHP order array by date? [duplicate]
- Set timezone in PHP and MySQL
- PHP, Get tomorrows date from date
- Calculate total seconds in PHP DateInterval
- How to convert ISO8601 to Date format in php
- How do I find the hour difference between two dates in PHP?
- mysql – INSERT date range into date columns IF dates don’t overlap with existing ones
- How do you explain the result for a new \DateTime(‘0000-00-00 00:00:00’)?
- adding 1 day to a DATETIME format value
- Get a PHP DateTime difference in days, considering midnight as a day change
- day of the week to day number (Monday = 1, Tuesday = 2)
- Converting to date in PHP from yyyymmdd format
- Subtracting a certain number of hours, days, months or years from date
- How do I convert an ISO8601 date to another format in PHP?
- Get date for monday and friday for the current week (PHP)
- Determine If Business Is Open/Closed Based On Business Hours