Posted By

Zwendel on 10/26/09


Tagged

day unix timestamp of end strtotime


Versions (?)

Find end of some day in unix timestamp format


 / Published in: PHP
 

  1. /* $_SESSION['plusDate'] is input in "-1" style*/
  2. $_SESSION['plusDate'] = datumObj::toUnix(
  3. datumObj::fromUnix( strtotime($_SESSION['plusDays']." days") ) ,
  4. '23:59:59'
  5. );
  6.  
  7. /* based on this class */
  8. class datumObj
  9. {
  10. public static function toUnix($datum , $uur)
  11. {
  12. list($d, $m, $y) = sscanf($datum, "%d/%d/%d");
  13. return strtotime("$m/$d/$y $uur");
  14. }
  15.  
  16. public static function fromUnix( $timestamp ){
  17. return date('d/m/Y',$timestamp);
  18. }
  19. }

Report this snippet  

You need to login to post a comment.