1
0
mirror of http://git.whoc.org.uk/git/password-manager.git synced 2024-11-14 18:29:02 +01:00

Update the date function to match strict datetime values in

mysql/mariadb databases
This commit is contained in:
Graham Eades 2019-05-16 12:21:07 +01:00
parent efa0e80186
commit 29b68415ca

View File

@ -127,7 +127,7 @@ class record extends POG_Base
$this->version = $this->Unescape($row['version']); $this->version = $this->Unescape($row['version']);
$this->creation_date = $row['creation_date']; $this->creation_date = $row['creation_date'];
$oDate = strtotime($row['update_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']; $this->access_date = $row['access_date'];
} }
return $this; return $this;
@ -220,7 +220,7 @@ class record extends POG_Base
$record->version = $this->Unescape($row['version']); $record->version = $this->Unescape($row['version']);
$record->creation_date = $row['creation_date']; $record->creation_date = $row['creation_date'];
$oDate = strtotime($row['update_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']; $record->access_date = $row['access_date'];
$recordList[] = $record; $recordList[] = $record;
} }
@ -235,8 +235,8 @@ class record extends POG_Base
function Save($deep = true) function Save($deep = true)
{ {
$connection = Database::Connect(); $connection = Database::Connect();
$this->update_date = date( 'r'); $this->update_date = date( 'Y-m-d H:i:s');
$this->access_date = date( 'r'); $this->access_date = date( 'Y-m-d H:i:s');
$this->pog_query = "select `recordid` from `record` where `recordid`='".$this->recordId."' LIMIT 1"; $this->pog_query = "select `recordid` from `record` where `recordid`='".$this->recordId."' LIMIT 1";
$rows = Database::Query($this->pog_query, $connection); $rows = Database::Query($this->pog_query, $connection);
if ($rows > 0) if ($rows > 0)