Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 3rd, 2012  |  syntax: None  |  size: 0.37 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php defined('SYSPATH') or die('No direct script access.');
  2.  
  3. class Mssql_Util {
  4.  
  5.   public static function parse_date($date, $with_time = FALSE, $interval = FALSE)
  6.   {
  7.     $date = new DateTime($date);
  8.     if ($interval)
  9.     {
  10.       $date->modify('+' . $interval . ' hour');
  11.     }
  12.     $format = ($with_time) ? 'd/m/Y H:i:s' : 'd/m/Y';
  13.     return $date->format($format);
  14.   }
  15. }