0

I am getting following error while fetching data through API. There are two parameters which get passed in the call. 1) Sequence Number (I am sure that this is working fine) 2) Time Zone - This one I am not able to crack the format/value whihc should be given.

<html><head><title>Slim Application Error</title><style>body{margin:0;padding:30px;font:12px/1.5 Helvetica,Arial,Verdana,sans-serif;}h1{margin:0;font-size:48px;font-weight:normal;line-height:48px;}strong{display:inline-block;width:65px;}</style></head><body><h1>Slim Application Error</h1><p>The application could not run because of the following error:</p><h2>Details</h2><div><strong>Type:</strong> ErrorException</div><div><strong>Code:</strong> 2</div><div><strong>Message:</strong> date_default_timezone_get(): 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.</div><div><strong>File:</strong> /var/www/api/v1/index.php</div><div><strong>Line:</strong> 199</div><h2>Trace</h2><pre>#0 [internal function]: Slim\Slim::handleErrors(2, 'date_default_ti...', '/var/www/api/v1...', 199, Array)

1 /var/www/api/v1/index.php(199): date_default_timezone_get()

2 /var/www/api/v1/include/DbHandler.php(183): ConvertGMTToLocalTimezone('2016-05-10 01:1...', 'sun.util.calend...')

3 /var/www/api/v1/index.php(67): DbHandler->getArticle('7000', 'sun.util.calend...')

4 [internal function]: {closure}()

5 /var/www/api/libs/Slim/Route.php(436): call_user_func_array(Object(Closure), Array)

6 /var/www/api/libs/Slim/Slim.php(1307): Slim\Route->dispatch()

7 /var/www/api/libs/Slim/Middleware/Flash.php(85): Slim\Slim->call()

8 /var/www/api/libs/Slim/Middleware/MethodOverride.php(92): Slim\Middleware\Flash->call()

9 /var/www/api/libs/Slim/Middleware/PrettyExceptions.php(67): Slim\Middleware\MethodOverride->call()

10 /var/www/api/libs/Slim/Slim.php(1254): Slim\Middleware\PrettyExceptions->call()

11 /var/www/api/v1/index.php(275): Slim\Slim->run()

12 {main}

What value should I pass in time_zone to get a 200 Ok response.

  • Usually when you search for some part of the error message you can already find an answer. Check this thread. http://stackoverflow.com/questions/16765158/date-it-is-not-safe-to-rely-on-the-systems-timezone-settings . Also a list of supported timezones: http://php.net/manual/en/timezones.php – Artur K. May 17 '16 at 15:51
  • Thanks Artur. I did find this solution, but couldn't interpret it properly. But now my issue got resolved because of your recommendation . – Tarun K May 18 '16 at 16:54

0 Answers0