How to set time zone in codeigniter

0 votes

I am working in a php project using codeigniter. Please advise me what is the global way to set time zone for php and mysql . In which file I can set this. I want to set it without php.ini and .htaccess file.

currently I am using this before every entry -:

date_default_timezone_set("Asia/bhubaneswar");
$time =  Date('Y-m-d h:i:s');
Nov 6, 2020 in PHP by kartik
• 37,510 points
1,527 views

1 answer to this question.

0 votes

Hii,

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

date_default_timezone_set('Asia/bhubaneswar');
answered Nov 6, 2020 by Niroj
• 82,800 points

Related Questions In PHP

0 votes
0 answers

How to get time in Indian Time zone?

We are setting start Schedule time and ...READ MORE

Jul 30 in PHP by Kithuzzz
• 20,660 points
77 views
0 votes
1 answer

How to set max_execution_time in PHP CLI?

Hello, set_time_limit() works in CLI scripts. <?php set_time_limit(1); //in ...READ MORE

answered Nov 14, 2020 in PHP by Niroj
• 82,800 points
473 views
0 votes
0 answers

How to increase maximum execution time in php

I want to increase the maximum execution time in ...READ MORE

Jun 17 in PHP by narikkadan
• 37,660 points
78 views
0 votes
0 answers
+1 vote
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,800 points
16,332 views
0 votes
1 answer

What is redirection in Laravel?

Named route is used to give specific ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,800 points
1,878 views
0 votes
1 answer

How to install Laravel via composer?

Hello, This is simple you just need to ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,800 points
1,568 views
+1 vote
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,800 points
22,957 views
0 votes
1 answer

How to do error logging in CodeIgniter ?

Hello @kartik, CodeIgniter has some error logging functions ...READ MORE

answered May 19, 2020 in PHP by Niroj
• 82,800 points
12,518 views
0 votes
1 answer

How to set upload_max_filesize in .htaccess?

Hello @kartik, php_value upload_max_filesize 30M is correct. You will have ...READ MORE

answered Oct 22, 2020 in PHP by Niroj
• 82,800 points
717 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP