Um, yeah you are using it wrong.
UNIX_TIMESTAMP() is for converting from the kind of date that MySQL stores (2007-09-19 00:00:00 for example) into a Unix timestamp (1189451850 for example, as Spatial said). The converse of this, is using FROM_UNIXTIME(), which converts the Unix timestamp into MySQL's format.
In your code, you are essentially storing a MySQL formatted date, into a Unix timestamp, making it an invalid entry for a DATETIME column, thus making it goto the default value of 0000-00-00 00:00:00). You shouldn't be doing this. If you have it already in the format, you should leave it and store it that way. Then, if you need it as a timestamp for your PHP functions, use UNIX_TIMESTAMP() when pulling it out.
Examples. MySQL connection assumed.
<?php
$timestamp = time(); // Timestamp for right now
// Inserting - this would be more efficient using NOW()
// if we were doing the date of right now, but bear with me
mysql_query("INSERT INTO `table`(`timestamp`) VALUES(FROM_UNIXTIME({$timestamp}))") or die(mysql_error());
// It is now stored in the YYYY-MM-DD HH:MM:SS format for MySQL
// Selecting back as a timestamp for our PHP functions
$query = mysql_query("SELECT UNIX_TIMESTAMP(`timestamp`) AS time FROM `table`") or die(mysql_error());
$result = mysql_fetch_row($query);
// Now $result['time'] is equal to the Unix timestamp,
// and can be directly used in functions like date(), etc
?>
If you store dates in this way, you can use MySQL's date comparing functions for sorting and such. (
More information).