Setting the Timezone for PHP in the php ini file

0 votes

I'm trying to change the default PHP timezone to Asia/Calcutta by accessing the /etc/php5/cli/php.ini file and changing

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
;date.timezone =

To

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "Asia/Calcutta"

But when I use phpinfo() to view the current timezone, it displays as Europe/Berlin time. Although I restarted and stopped the Apache server, the settings didn't appear to have changed.

Is there a step in the process that I'm overlooking?

Aug 1, 2022 in PHP by Kithuzzz
• 38,000 points
1,054 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In PHP

0 votes
1 answer

How to find the php.ini file from the command line?

Hello @kartik, You can get a full phpinfo() using : php ...READ MORE

answered May 19, 2020 in PHP by Niroj
• 82,840 points
54,080 views
0 votes
0 answers

How to locate the php.ini file (xampp)?

I am using xampp server for PHP ...READ MORE

Jun 9, 2022 in PHP by Kichu
• 19,040 points
1,630 views
0 votes
0 answers

What's the maximum value for an int in PHP?

Ignoring the special libraries that allow you ...READ MORE

Jul 25, 2022 in PHP by Kithuzzz
• 38,000 points
594 views
0 votes
1 answer

What is meant by passing the variable by value and reference in PHP?

Hello, When the variable is passed as value ...READ MORE

answered Mar 27, 2020 in PHP by Niroj
• 82,840 points
3,284 views
0 votes
1 answer

How do I get the current date and time in PHP?

The time would go by your server ...READ MORE

answered Feb 16, 2022 in Others by Aditya
• 7,680 points
725 views
0 votes
0 answers

What php timezone I use for San Francisco, California, United Stated

What PHP time zone can I use ...READ MORE

May 27, 2022 in PHP by Kichu
• 19,040 points
636 views
0 votes
0 answers

Convert one date format into another in PHP

How can I convert one date format ...READ MORE

Jun 20, 2022 in PHP by Kithuzzz
• 38,000 points
314 views
0 votes
0 answers

How to calculate the difference between two dates using PHP?

I have two dates on the form: Start ...READ MORE

Jun 24, 2022 in PHP by narikkadan
• 63,600 points
696 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