Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

compare two 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 #datetime #php
ADD COMMENT
Topic
Name
1+8 =