title: How can I change date and time using timestamp argument of date function?
body: <p>When I use <code>date()</code> function to display date, it's not according to local time zone. I want it to be according to the local time zone. Can it be done using the <code>timestamp</code> parameter of this function?</p>
  
  <p>Actually I don't know what the <code>timestamp</code> parameter is. How do I use it to alter date and time?</p>
  
  <p>Secondly, is there any other function that can set date time according to our time zone?</p>
  
  <p>Here's what I've tried but it's not working:</p>
  
  <pre><code>&lt;?php
  $conn=mysqli_connect("localhost", "root", "", "winkcage");
  if(isset($_POST["cmessage"])){
  $messages=$_POST["cmessage"];
  $sender=$_SESSION["unamsession"];
  $receiver="vinaykumar";
  $timedate=date("Y-m-d h:i:sa");
  $time=date_default_timezone_set("Asia/Calcutta");
  $sendquery="INSERT INTO messages(sender, receiver, message, time) VALUES('$sender', '$receiver', '$messages', '$time')";
  $sendqueryrun=mysqli_query($conn, $sendquery);
  }
  ?&gt;
  </code></pre>