title: Client Time in PHP
body: <p>PHP, as far as I know, can only find the time on server-side. I want the time to be in client time. My approach was to use Javascript, get the client's time, pass it to PHP. This works, but I need to store this "time" in a <code>log</code> file. Here is my code so far:</p>
  
  <p><strong>JS</strong></p>
  
  <pre><code>var d = new Date();
  document.getElementById("timestamp").value = d.getTime() / 1000;
  </code></pre>
  
  <p><strong>PHP</strong></p>
  
  <pre><code>$datevar = date('d/m/Y', $_POST['timestamp']) . ' at ' . date('h:i', $_POST['timestamp']) . PHP_EOL;
  
  $log_file_name = '1.log'; 
  file_put_contents($log_file_name, $variable .":  $variable,  $variable, $datevar"  , FILE_APPEND);
  </code></pre>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;form name="contactform" method="post" action="survey.php"&gt;
  &lt;input type="hidden" id="timestamp" name="timestamp" value="" /&gt;
  &lt;input name="submit" type="submit" value="Submit"&gt; 
  &lt;/form&gt;
  </code></pre>
  
  <p>With the above code, the log file just shows exactly the JS code, not the actual time.</p>
  
  <p>I would like to store the actual client time. Any help will be appreciated. Thank you in advance.</p>