I was trying to get server's DATE with php, then pc's TIME with javascript and save them into my database. The problem is that I can store sever's date but not pc's time in my database. This is my database: jobs(id, date, time) . Structure type in my database for date set to DATE and for time set TIME Any idea what the problem might be? This is my code:
<?php
// get sever's date
$server_date = date('Y.m.d');
// get pc's time
$pc_time='
<script language="javascript">
var today = new Date();
today = today.getHours() + ":" + today.getMinutes()+":" + today.getSeconds();
document.write(today);
</script>';
mysql_query("INSERT INTO `jobs` VALUES ('', '$server_date ', '$pc_time') ");
?>
I can succesfully store server's date but not the time.