コード例 #1
0
ファイル: DNBranch.php プロジェクト: ss23/deploynaut
 /**
  *
  * @return SS_Datetime
  */
 public function LastUpdated()
 {
     $created = $this->branch->getCommit()->getCommitterDate();
     // gitonomy sets the time to UTC, so now we set the timezone to
     // whatever PHP is set to (date.timezone). This will change in the future if each
     // deploynaut user has their own timezone
     $created->setTimezone(new DateTimeZone(date_default_timezone_get()));
     $d = new SS_Datetime();
     $d->setValue($created->format('Y-m-d H:i:s'));
     return $d;
 }
コード例 #2
0
ファイル: DNBranch.php プロジェクト: silverstripe/deploynaut
 /**
  * @return SS_Datetime
  */
 public function LastUpdated()
 {
     if ($this->_lastUpdatedCache) {
         return $this->_lastUpdatedCache;
     }
     try {
         $created = $this->branch->getCommit()->getCommitterDate();
     } catch (Exception $e) {
         //occasionally parsing will fail this is a fallback to make it still work
         return new SS_Datetime();
     }
     $created->setTimezone(new DateTimeZone(date_default_timezone_get()));
     $date = SS_Datetime::create();
     $date->setValue($created->format('Y-m-d H:i:s'));
     $this->_lastUpdatedCache = $date;
     return $date;
 }
コード例 #3
0
 /**
  * @return SS_Datetime
  */
 public function LastUpdated()
 {
     if ($this->_lastUpdatedCache) {
         return $this->_lastUpdatedCache;
     }
     try {
         $created = $this->branch->getCommit()->getCommitterDate();
     } catch (Exception $e) {
         //occasionally parsing will fail this is a fallback to make it still work
         return new SS_Datetime();
     }
     // gitonomy sets the time to UTC, so now we set the timezone to
     // whatever PHP is set to (date.timezone). This will change in the future if each
     // deploynaut user has their own timezone
     $created->setTimezone(new DateTimeZone(date_default_timezone_get()));
     $date = new SS_Datetime();
     $date->setValue($created->format('Y-m-d H:i:s'));
     $this->_lastUpdatedCache = $date;
     return $date;
 }