"Warning: date(): It is not safe to rely on the system's timezone settings."

57 views
Skip to first unread message

Erik Mulder

unread,
Nov 21, 2015, 3:41:45 PM11/21/15
to google-analytics-analyticsjs
Hi folks,

I get a warning on my website without me making any changes. The warning is : "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 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 - See more at: ...
I retraced this warning to the following script:
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'XXXXXXXX', 'auto');
  ga('send', 'pageview');

</script>

Is it correct to change it here to the suggested function :  date_default_timezone_set()  
By the way, what caused the change?

Thx
Erik
Reply all
Reply to author
Forward
0 new messages