title: PHP mySQL CURRENT_TIMESTAMP incorrect time shown in database in cPanel
body: <p>I am living in Sri Lanka. I have this code to record the current date and time when invalid login done.</p>
  
  <pre><code>$insert_query = "INSERT INTO LoginAttempt(IpAddress, LoginAt) VALUES('". $_SERVER['REMOTE_ADDR']. "', CURRENT_TIMESTAMP)";
  </code></pre>
  
  <p>I have uploaded to hostinger.co.uk which is free webhosting service for educational purpose.</p>
  
  <p>That inserted into table successfully. It shows the date correct. But time is about 5 hours and 30 minutes less than the actual time. 
  Is there any way to change timezone in cPanel or programmatically in the PHP script?</p>
  
  <p>What I have tried;</p>
  
  <p>1)  addes this. but does not work!      date_default_timezone_set('Asia/Colombo');</p>
  
  <p>Another soulution to use <code>DATE_ADD</code> function to add the particular missing hours.</p>
  
  <p>What are your another ideas? Thanks</p>
  
  <p>MySQL table;</p>
  
  <pre><code>    CREATE TABLE LoginAttempt(
      LoginId INT NOT NULL AUTO_INCREMENT,
      IpAddress VARCHAR(20) NOT NULL,
      LoginAt DATETIME NOT NULL DEFAULT NOW(),
      PRIMARY KEY(LoginId)
  );
  </code></pre>
  
  <p><strong>Solution that worked!!!!</strong></p>
  
  <pre><code>$insert_query = "INSERT INTO LoginAttempt(IpAddress, LoginAt) VALUES('". $_SERVER['REMOTE_ADDR']. "', CONVERT_TZ(NOW(), 'UTC', 'Asia/Colombo') )";
  </code></pre>