$olddate = "2010-03-24"; $currentdate = date('Y-m-d'); $diff = abs(strtotime(
$currentdate
) - strtotime($olddate)); $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)); printf("%d years, %d months, %d days\n", $years, $months, $days);
Application development and sharing our knowledge to developer to developer for helping knowledge to build a effective solution for web architect.
Sunday, February 10, 2013
two date difference in php
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment