Skip to content

Instantly share code, notes, and snippets.

@blar
Created February 13, 2014 13:35
Show Gist options
  • Select an option

  • Save blar/8975104 to your computer and use it in GitHub Desktop.

Select an option

Save blar/8975104 to your computer and use it in GitHub Desktop.
<?php
$foo = new DateTime('2014W08');
$bar = new DateTime('tuesday this week');
$diff = $foo->diff($bar);
var_dump($diff->format('%a'));
string(1) "6"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment