WIKINDX METHODS

Method:
formatTimestamp()

Class:
SQL

Method Call:
include_once("core/sql/SQL.php");
$db = new SQL();
STRING $db->formatTimestamp([UNIX EPOCH SECONDS: time()]);

Description:
Format a UNIX epoch time into a format suitable for inserting or updating a DATETIME or TIMESTAMP database field type. By default the current time will be returned.

Usage:

For example (assuming the database object exists within a class as $this->db):

		$this->db->insert('WKX_resource_timestamp', array('id', 'timestamp'), 
			array(103, $this->db->formatTimestamp()));

WIKINDX home      WIKINDX usage      WIKINDX classes