Posts

Showing posts from August, 2013

Accurate time using PHP

<?php     function ezDate($d) {         $ts = time() - strtotime(str_replace("-","/",$d));                 if($ts>31536000) $val = round($ts/31536000,0).' year';         else if($ts>2419200) $val = round($ts/2419200,0).' month';         else if($ts>604800) $val = round($ts/604800,0).' week';         else if($ts>86400) $val = round($ts/86400,0).' day';         else if($ts>3600) $val = round($ts/3600,0).' hour';         else if($ts>60) $val = round($ts/60,0).' minute';         else $val = $ts.' second';                 if($val>1) $val .= 's';   ...

Date/Time in PHP

<?PHP      //Current Year     $year = date("Y");      //2013         //Current Month     $month = date("m");    //08         //Current day     $day = date("d");     //12         //Tomorrow's day     $day = date("d")+1;    //13             //TODAY'S DATE          $start =  date("Y-m-d");     //2013-08-12               //1 MONTH FROM TODAY          $end = date("Y-m-d",strtotime("+1 months"));     //2013-09-12          //5 DAYS FROM TODAY         $reminder = date("Y-m-d",strtotime("+5...