Skip to content

Instantly share code, notes, and snippets.

@sotarok
Created April 4, 2012 05:45
Show Gist options
  • Save sotarok/2298158 to your computer and use it in GitHub Desktop.
Save sotarok/2298158 to your computer and use it in GitHub Desktop.
<?php
/**
*
*/
$dt0 = '2010-02-01 00:02:33';
$dt1 = '2011-02-01 00:02:33';
$dt2 = '2012-02-01 00:02:33';
var_dump($dt1 - $dt0); // int(1)
var_dump($dt1 - $dt2); // int(-1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment