Viewed   69 times

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"

However, when I try to view current timezone under phpinfo(), the timezone follows the Europe/Berlin timezone.

I have tried stopping and restarting the Apache server, but that didn't seem to have changed the settings.

Is there something I'm missing in the process?

PS: I'm using PHP 5.6.8 currently under XAMPP.

 Answers

4

I tried all the other possible solutions posted, but none of them helped. This is what helped me save my timezone settings:

1) Go to your phpinfo() page and search for Loaded Configuration File and open the php.ini file mentioned under that section.

2) Change the default timezone settings by adding your new timezone by modifying this line: date.timezone=Asia/Kolkata.

3) Save the php.ini file and stop the Apache server.

4) Restart the Apache server. The timezone settings should now be modified.

Saturday, September 3, 2022
3

DateInterval is buggy on windows platform. See bug #51183. The official answer seems to be "use VC9 builds instead for now".

Monday, August 15, 2022
 
3

I use following wrapper class in my php5.2 apps: http://pastebin.ca/2051944. Untill php5.3 was released - it saves much my time

Thursday, November 3, 2022
 
5

You last is the best yet, but here is an other way

TS

for(let i=0; i < n; i++){ // n is array.length
   this.globalArray.push({ a1 : array1[i] , a2 : array2[i] , a3 : array3[i] });
}

HTML

<ion-item *ngFor="let item of globalArray;">
  {{item.a1}} {{item.a1}} {{item.a1}}
</ion-item>
Monday, December 26, 2022
 
anant
 
2

Dealing with C macros is a royal PITA. I have a dream that one day C programmers will do the rest of the world a favor and quit using them.

If it were me, I'd run the macro to see what it outputs, then write some Ada code to output the equivalent.

From reading through Roland's answer, it looks to me like the implementation-defined pragma linker_section may be required.

pragma Linker_Section ( [Entity =>] LOCAL_NAME, [Section =>] static_string_EXPRESSION);

LOCAL_NAME must refer to an object that is declared at the library level. This pragma specifies the name of the linker section for the given entity. It is equivalent to __attribute__((section)) in GNU C and causes LOCAL_NAME to be placed in the static_string_EXPRESSION section of the executable (assuming the linker doesn't rename the section).

Wednesday, October 5, 2022
 
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :