Fixed timestamp converstion not working

This commit is contained in:
jengo 2001-08-05 08:04:10 +00:00
parent e8bf8cbf0c
commit ccf42f2b2a
2 changed files with 4 additions and 4 deletions

View File

@ -127,12 +127,12 @@
function to_timestamp($epoch) function to_timestamp($epoch)
{ {
return date('YmdHis',$epoch); return date('Y-m-d H:i:s',$epoch);
} }
function from_timestamp($timestamp) function from_timestamp($timestamp)
{ {
ereg('([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})',$timestamp,$parts); ereg('([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})',$timestamp,$parts);
return mktime($parts[4],$parts[5],$parts[6],$parts[2],$parts[3],$parts[1]); return mktime($parts[4],$parts[5],$parts[6],$parts[2],$parts[3],$parts[1]);
} }

View File

@ -106,11 +106,11 @@
{ {
if (floor($this->db_version) == 6) if (floor($this->db_version) == 6)
{ {
return $this->from_timestamp_6($epoch); return $this->from_timestamp_6($timestamp);
} }
else else
{ {
return $this->from_timestamp_7($epoch); return $this->from_timestamp_7($timestamp);
} }
} }