SoftwarePHP timezone

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  CHYRON (DSMITHHFX)  
 To:  ALL
42880.1 
Trying to set PHP timezone from default UTC to America/Toronto ...

https://php.tutorials24x7.com/blog/set-same-timezone-in-php-mysql-and-apache

/etc/php/7.2/apache2/php.ini [Date] date.timezone = America/Toronto (also tried 'America/Toronto' and "America/Toronto"), restarted apache, did not appear to take when checked in phpinfo.php.

Can't find any *working* syntax examples for this.
"International student-turned-YouTube star has advice for others coming to Canada"
0/0
 Reply   Quote More 

 From:  CHYRON (DSMITHHFX)  
 To:  ALL
42880.2 
Well, like all things computer, it's stupidly complicated unless you already know the answer. Then it's perfectly obvious! (I'm guessing).

I'm trying to apply our local time zone to a php/mysql file server timestamps because strangely, not all servers are located in 'UTC'. Who knew?

Anyhoo, I messed around with setting the mysql time zone to 'America/Toronto' in the cli, which appears to have worked, but this isn't reflected in time stamps of newly-uploaded files.

Also unclear if this will survive a restart, who in their right mind would want that?

 >-|
"International student-turned-YouTube star has advice for others coming to Canada"
0/0
 Reply   Quote More 

 From:  william (WILLIAMA)  
 To:  CHYRON (DSMITHHFX)     
42880.3 In reply to 42880.1 
Not something like another date.timezone entry somewhere later in php.ini?

He May Be Your Dog But He's Wearing My Collar

0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  ALL
42880.4 
I very much recommend leaving all servers set to UTC always everywhere, and handling timezones when datetimes are output.
0/0
 Reply   Quote More 

 From:  CHYRON (DSMITHHFX)  
 To:  Peter (BOUGHTONP)     
42880.5 In reply to 42880.4 
Your cautionary note has me thinking my mtime-based incremental backups could be screwed up over this, if I actually got it working. Feature!
"International student-turned-YouTube star has advice for others coming to Canada"
0/0
 Reply   Quote More 

Reply to All    
 

1–5

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats