Skip to content

Instantly share code, notes, and snippets.

View manigandanta's full-sized avatar

Manigandan Arjunan manigandanta

View GitHub Profile
@manigandanta
manigandanta / datediff.php
Created May 18, 2012 04:38
difference b/w two dates
<?php
$date1 = $date;
$date2 = date("Y-m-d");
$diff = abs(strtotime($date2) - strtotime($date1));
//$years = floor($diff / (365*60*60*24));
$months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24));
//$days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24));