Exemple #1
0
 public static function daNativo(DateTime $nativo)
 {
     global $conf;
     $x = new DT();
     $x->setTimestamp($nativo->getTimestamp());
     $x->setTimezone(new DateTimeZone($conf['timezone']));
     return $x;
 }
 public static function fromTimestamp($ts, $tz = null)
 {
     $dt = new DT('@' . $ts);
     if ($tz == null) {
         $tz = new DateTimeZone(Config::get('intl.timezone'));
     }
     $dt->setTimezone($tz);
     return $dt;
 }