fix: [notes] changed timestamp output to not include timezone

- doesn't work on all versions of mariadb/mysql
pull/9440/head
iglocska 2024-02-23 10:18:29 +01:00
parent 6655697dbc
commit e6ec7871e3
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 4 additions and 4 deletions

View File

@ -155,13 +155,13 @@ class AnalystData extends AppModel
{
parent::beforeSave($options);
if (empty($this->data[$this->current_type]['created'])) {
$this->data[$this->current_type]['created'] = (new DateTime())->format('c');
$this->data[$this->current_type]['created'] = (new DateTime())->format('Y-m-d H:i:s');
}
if (empty($this->data[$this->current_type]['modified'])) {
$this->data[$this->current_type]['modified'] = (new DateTime())->format('c');
$this->data[$this->current_type]['modified'] = (new DateTime())->format('Y-m-d H:i:s');
}
$this->data[$this->current_type]['modified'] = (new DateTime($this->data[$this->current_type]['modified'], new DateTimeZone('UTC')))->format('c');
$this->data[$this->current_type]['created'] = (new DateTime($this->data[$this->current_type]['created'], new DateTimeZone('UTC')))->format('c');
$this->data[$this->current_type]['modified'] = (new DateTime($this->data[$this->current_type]['modified'], new DateTimeZone('UTC')))->format('Y-m-d H:i:s');
$this->data[$this->current_type]['created'] = (new DateTime($this->data[$this->current_type]['created'], new DateTimeZone('UTC')))->format('Y-m-d H:i:s');
return true;
}