Skip to content

Commit

Permalink
Merge pull request #1298 from nextcloud/fixIncorrectDateFormatDetection
Browse files Browse the repository at this point in the history
fix incorrect Date format detection
  • Loading branch information
solracsf committed Nov 1, 2023
2 parents c83431f + 3992bce commit be3de35
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Model/Circle.php
Expand Up @@ -912,7 +912,9 @@ public function importFromDatabase(array $data, string $prefix = ''): IQueryRow
->setDescription($this->get($prefix . 'description', $data));

$creation = $this->get($prefix . 'creation', $data);
$this->setCreation(DateTime::createFromFormat('Y-m-d H:i:s', $creation)->getTimestamp());
$dateTime = DateTime::createFromFormat('Y-m-d H:i:s', $creation);
$timestamp = $dateTime ? $dateTime->getTimestamp() : (int) strtotime($creation);
$this->setCreation($timestamp);

$this->setPopulation($this->getInt('population', $this->getSettings()));
$this->setPopulationInherited($this->getInt('populationInherited', $this->getSettings()));
Expand Down

0 comments on commit be3de35

Please sign in to comment.