Click here to Skip to main content

Linux, Apache, MySQL, PHP

 
AnswerRe: how to get date difference PinmemberPeter_in_278029-Sep-12 2:09 
GeneralRe: how to get date difference PinmemberMember 915215629-Sep-12 2:12 
GeneralRe: how to get date difference PinmemberPeter_in_278029-Sep-12 2:22 
AnswerRe: how to get date difference PinmemberDeepthi.214564-Oct-12 20:11 
<?php
$date1 = "2012-10-04 22:45:00";
$date2 = "2013-12-05 13:44:01";
$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));
$hours = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24)/ (60*60));
$minuts = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60)/ 60);
$seconds = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60 - $minuts*60));
printf("%d years, %d months, %d days, %d hours, %d minuts\n, %d seconds\n", $years, $months, $days, $hours, $minuts, $seconds);
die;
?>

AnswerRe: how to get date difference PinmemberAnilannu6-Oct-12 6:30 
AnswerRe: how to get date difference PinmemberMohibur Rashid9-Oct-12 21:25 
QuestionHosting PHP application locally Pinmemberawedaonline20-Sep-12 5:24 
AnswerRe: Hosting PHP application locally PinmemberMohibur Rashid22-Sep-12 3:13 
GeneralRe: Hosting PHP application locally Pinmemberawedaonline23-Sep-12 21:19 
AnswerRe: Hosting PHP application locally Pinmembermaba0018-Oct-12 19:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.140926.1 | Last Updated 9 Sep 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid