If you're getting a warning it's because your server isn't properly configured and you should be set the default time zone in your server's php.ini file.  This shouldn't be handled by the code.