如何在php中设置印度标准时间?

I'm using PHP codeigniter so here I want to get current national time. I tried NOW() in my sql code but when server change the location the server time changes. if I give date() it will take our system current time I think. in date()case if some user have some wrong date time then it will store that wrong time. So how can I solve this problem.

Set default timezone to India in the starting of the php code

date_default_timezone_set('Asia/Kolkata');

the query

 $query = "INSERT INTO oc_customer SET date_added = ' ".date("Y-m-d H:i:s") ." ' "; 

in your project index.php just put following code at line no 2

date_default_timezone_set('Asia/Kolkata');

or check timezone here

http://php.net/manual/en/timezones.asia.php

Placing this date_default_timezone_set('Asia/Kolkata'); Put it in config/config.php, It will work for whole application

OR

Add this line to autoload.php in the application folder:

$autoload['time_zone'] = date_default_timezone_set('Asia/Kolkata');

OR

Add this line inside the main index.php of codeigniter folder

date_default_timezone_set('Asia/Kolkata');

Few clarity,

date_default_timezone_set does not have any effect on sql NOW().

Also, server date/time does not depend on users' system unless you are fetching it in javascript.

Here is the list of timezones PHP Provides, so eventually codeigniter does PHP Timezones

Here is the way where you can list out timezones in CI and can use further.

$timezones =  DateTimeZone::listIdentifiers(DateTimeZone::ALL);

 foreach ($timezones as $timezone) 
 {
    echo $timezone;
    echo "</br>";
 }

Also maybe by researching I have found the way is by keeping in config.php file.

<?php

defined('BASEPATH') OR exit('No direct script access allowed');

date_default_timezone_set('Asia/Kolkata');