Getting a datetime to php from javascript array <p>I'm working with a JQuery datetime picker and am trying to save the selected date time into the php variable in order to save it into mysql database. I've seen alot of different eaxmples on here and have tried a few but none seem to be working for me. The output of the date time seems to be outputed to an array, this is where i am having difficulty before conversion.</p> <p>this is my JQuery picker and posting method: </p> <pre><code>$(function () { $('*[name=date2]').appendDtpicker({ "inline": true, "allowWdays": [1, 2, 3, 4, 5], // 0: Sun, 1: Mon, 2: Tue, 3: Wed, 4: Thr, 5: Fri, 6: Sat "futureOnly": true, "autodateOnStart": false }); $('#btn_input').on('click', function () { var input = $('*[name=date2]').handleDtpicker('getDate'); console.log(input); $.post("backend.php", { 'input': input }).done(function (data) { alert("Server Response: " + data); }); }); }); </code></pre> <p>This is the backend.php:</p> <pre><code>&lt;?php session_start(); print_r($_POST); ?&gt; </code></pre> <p>and finally this is the output in the alert:</p> <pre><code>Server Response: Array ( [input] =&gt; Tue Mar 31 2015 11:20:00 GMT+0100 (GMT Standard Time) ) </code></pre> <p>and the output if backend.php is run:</p> <pre><code>Array ( ) </code></pre> <p>If anyone can point me in the right direction i appreciate all the help, new to php and very confused!</p>