The Unix timestamp represents the time measured in seconds since the start of the Unix epoch (January 1st, 1970). The Unix timestamp is often inserted into databases, to date the records.
Getting the Unix timestamp in PHP is done by using the time() function, which returns the current Unix timestamp of the server. Here we output the current Unix timestamp:
And here we instert it into a sample database table:
|mysql_query(“INSERT INTO MyTable(RowDate) VALUES(‘”.time().“‘)”);|