Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

compare dates datetime php

$date1 = new DateTime("now");
$date2 = new DateTime("tomorrow");

var_dump($date1 == $date2); // false
var_dump($date1 < $date2); // true
var_dump($date1 > $date2); // false
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #compare #dates #datetime #php
ADD COMMENT
Topic
Name
3+1 =