Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev
Reply
  #1  
Old 22nd May 2021, 12:59
elvira's Avatar
elvira elvira is offline
Senior Member
 
Join Date: Jan 2008
Slovenia
Posts: 172
Default PHP Warning
Hello all,


I have this warning in announce.php, so what is to do.


Code:
[Sat May 22 12:55:52.087372 2021] [:error] [pid 19406] [client 86.61.53.162:36312] PHP Warning:  strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/admin/web/noviteti.net/public_html/announce.php on line 160
Code:
[Sat May 22 12:55:52.087409 2021] [:error] [pid 19406] [client 86.61.53.162:36312] PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and

line 160 and 161 is:


Code:
$dt = strtotime(date('Y-m-d H:i:s')) - 180;
$dt = sqlesc(date('Y-m-d H:i:s', $dt));
Reply With Quote
  #2  
Old 22nd May 2021, 13:53
DND DND is offline
VIP
 
Join Date: Dec 2008
Posts: 1,241
Default
  • Modifying php.ini.
  • Adding date_default_timezone call.
Instead of date you could use gmdate.

or easier..in your config.php or bittorrent.php or whatever global file you have just define the default timezone
date_default_timezone_set('Europe/London');
__________________
Need HELP!? I can install:

  1. Server/VPS (Debian,CentOS,Ubuntu,Fedora, FreeBSD) Optimization and ... + Modules
  2. Webserver Windows/Linux (Apache/Lighttpd/Nginx/Mysql/PhpMyAdmin/SSL) Optimization and ... + Modules
  3. Seedbox Windows/Linux (uTorrent,rTorrent,libTorrent,ruTorrent) + Modules
  4. Multiple source code engines
  5. Linux Server Administration (security, cryptography/encryption, proxy, load balancer, custom ddos firewall)
Reply With Quote
  #3  
Old 22nd May 2021, 15:31
elvira's Avatar
elvira elvira is offline
Senior Member
 
Join Date: Jan 2008
Slovenia
Posts: 172
Default
Like this


Code:
$dt = gmdate('Y-m-d H:i:s') - 180;
$dt = sqlesc(gmdate("Y-m-d H:i:s"));
Reply With Quote
  #4  
Old 22nd May 2021, 15:46
Elena Elena is offline
Senior Member
 
Join Date: Sep 2010
P2P
Posts: 111
Default
Quote:
Originally Posted by elvira View Post
Like this


Code:
$dt = gmdate('Y-m-d H:i:s') - 180;
$dt = sqlesc(gmdate("Y-m-d H:i:s"));
Code:
$sec = 4*86400; // 4 days 
$dt = sqlesc(get_date_time(gmtime() - $sec));
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 01:39. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.