Skip to content

Instantly share code, notes, and snippets.

@shigemk2
Created February 23, 2013 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shigemk2/5020312 to your computer and use it in GitHub Desktop.
Save shigemk2/5020312 to your computer and use it in GitHub Desktop.
datetime型 format %a は経過日数を調べる
<?php
$date1 = new Datetime('2012-02-01');
$date2 = new Datetime();
$array = $date1->diff($date2);
var_dump($array->format('%a') > 40);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment