From 29b68415ca1fd8e5d895ddeb259e5e6864f4725b Mon Sep 17 00:00:00 2001 From: Graham Eades Date: Thu, 16 May 2019 12:21:07 +0100 Subject: [PATCH] Update the date function to match strict datetime values in mysql/mariadb databases --- backend/php/src/objects/class.record.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/php/src/objects/class.record.php b/backend/php/src/objects/class.record.php index 2ab5c4a..444116e 100644 --- a/backend/php/src/objects/class.record.php +++ b/backend/php/src/objects/class.record.php @@ -127,7 +127,7 @@ class record extends POG_Base $this->version = $this->Unescape($row['version']); $this->creation_date = $row['creation_date']; $oDate = strtotime($row['update_date']); - $this->update_date = date('r', $oDate); + $this->update_date = date('Y-m-d H:i:s', $oDate); $this->access_date = $row['access_date']; } return $this; @@ -220,7 +220,7 @@ class record extends POG_Base $record->version = $this->Unescape($row['version']); $record->creation_date = $row['creation_date']; $oDate = strtotime($row['update_date']); - $record->update_date = date('r', $oDate); + $record->update_date = date('Y-m-d H:i:s', $oDate); $record->access_date = $row['access_date']; $recordList[] = $record; } @@ -235,8 +235,8 @@ class record extends POG_Base function Save($deep = true) { $connection = Database::Connect(); - $this->update_date = date( 'r'); - $this->access_date = date( 'r'); + $this->update_date = date( 'Y-m-d H:i:s'); + $this->access_date = date( 'Y-m-d H:i:s'); $this->pog_query = "select `recordid` from `record` where `recordid`='".$this->recordId."' LIMIT 1"; $rows = Database::Query($this->pog_query, $connection); if ($rows > 0)