-5

When I used this script:

    <?php
print strftime('%c');
?> 

I get

Warning: strftime(): 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 /usr/local/www/apache22/data/virtual/midterm/boballo.php on line 3
Sun Jul 6 20:41:17 2014

All I am trying to show is the current date/time of the server and print it to php script. I thought the server (freebsd) would of set the time zone. How can I show the current date of the server and print it with php script?

Benjamin Jones
  • 987
  • 4
  • 22
  • 50

1 Answers1

5

Well, read what the error message is telling you, the most important part:

You are required to use the date.timezone setting or the date_default_timezone_set() function.

Do it!

Fleshgrinder
  • 15,703
  • 4
  • 47
  • 56