Esempio n. 1
0
 private function calculateMilestoneDueDate($milestonePoints)
 {
     $secsTranspired = ceil($milestonePoints / $this->ptsPerSecond);
     $intervalSeconds = "PT" . $secsTranspired . "S";
     $sDate = clone $this->startDateUTC;
     $dueDate = $sDate->add(new \DateInterval($intervalSeconds));
     //set to user's timezone
     $localDate = Utils::setLocalTimezone($dueDate);
     return $localDate;
 }
Esempio n. 2
0
 public function convertDatesUTCLocal()
 {
     $utcTime = Utils::convertLocalDateTimeToUTC(new DateTime('now'));
     echo "UTC:" . json_encode($utcTime);
     $localTime = Utils::convertUTCDateTimetoLocal($utcTime);
     echo "MOUNTAIN" . json_encode($localTime);
 }
Esempio n. 3
0
 public function setEndDateAttribute($value)
 {
     //first convert it to local so it has the right timezone property. Then save it in UTC to the DB
     $date = Utils::setLocalTimezone($value);
     $this->attributes['end_date'] = Utils::setUTCTimezone($date);
 }