'PHP my timezone is no setting up in PHP.ini File in xampp

I've xampp installed on my Local PC. But I've a Problem in my Timezone. PHP date shows my Date & Time 02/11/2018 05:26:18. but my PC Time is 02/11/2018 09:26:18. My Timezone is Asia/Karachi. I've Changed My Timezone in php.ini and My Timezone in php.ini Look like this

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

I've also changed the right php.ini file according to phpinfo. I've restarted my Server many times but still getting the same timezone . My PHP version is 7.1.10



Solution 1:[1]

As @Shaida Muhammad suggested in comments to the question, there seems to be a second date.timezone in php.ini for xampp. You can safely remove/comment the second date.timezone.

[Date]
date.timezone=Asia/Kolkata

Solution 2:[2]

I have had the same issue, instead of going everywhere else i just clicked on Apache config button in xampp control panel and clicked on php.ini.

There is a second timezone line in that file go and search for it you will find your solution there.

[Syslog]
define_syslog_variables=Off
[Session]
define_syslog_variables=Off
[Date]
date.timezone=Asia/Karachi
[MySQL]

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ande Yashwanth
Solution 2 Usama Zahid