Skip to content

Instantly share code, notes, and snippets.

@pastak
Created May 12, 2013 05:53
Show Gist options
  • Select an option

  • Save pastak/5562576 to your computer and use it in GitHub Desktop.

Select an option

Save pastak/5562576 to your computer and use it in GitHub Desktop.
<?php
$birthday = '09/15/1993';
//$bd = date('Y-m-d', strtotime($birthday));
$birthdata = new DateTime($birthday);
$today = new DateTime("now");
$interval = date_diff($birthday,$today);
$interval->format(Y);
?>
@tyage

tyage commented May 12, 2013

Copy link
Copy Markdown

$interval->format("Y");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment