session_start() needs to be called before any output are sent to the browser, both headers and content. So include it at the top of your script to be sure.
Also make sure that you have added the ending ";" semicolon.
-----StartCode-----
$TimeStamp = time();
mysql_query("INSERT INTO student (Sname, Sdata) VALUES (
'TimeStamp',
'$TimeStamp')", $Connection) or die(mysql_error());
-----CodeEnd-----
Remember that the time function will be in the unix format, this means you have to do something like below to output the time in a "readable" date format.
-----StartCode-----
echo date("d/m/Y", $TimeStamp');
-----CodeEnd-----
It is generally best to post the Unix date format in the database, as its easier to work with then "readable" formats, simply use above whenever you are going to output date/time to the browser.
See also:
http://www.php.net/session
http://www.php.net/time