It puts it into the format "2005-02-01". I store all my dates in mySQL database in the Unix timestamp format. The question is, how do I convert the date in that field to Unix timestamp before it is updated in the table?
This is the part of my code that dreamweaver uses to update the table row:
Code: Select all
if ((isset($_POSTї"MM_update"])) && ($_POSTї"MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE invoices SET invoicetype=%s, customerid=%s, terms=%s, orderdate=%s, completiondate=%s, status=%s, paidinfull=%s, notes=%s WHERE invoiceid=%s",
GetSQLValueString($_POSTї'invoicetype'], "text"),
GetSQLValueString($_POSTї'customerid'], "int"),
GetSQLValueString($_POSTї'terms'], "text"),
-->GetSQLValueString($_POSTї'orderdate'], "int"),
GetSQLValueString($_POSTї'completiondate'], "int"),<--
GetSQLValueString($_POSTї'status'], "text"),
GetSQLValueString($_POSTї'paidinfull'], "int"),
GetSQLValueString($_POSTї'editnotes'], "text"),
GetSQLValueString($_POSTї'invoiceid'], "int"));1: attaching a time to the datestamp (12pm Noon will be fine for all of them)
2: convert the variable into timestamp using something like
$orderdate = date("U",$orderdate);
3: putting that value into this update query.
I'm just not sure how to do that.