Error for few timezones because of DateTimeZone function
-
Thanks for the great plugin, i am using your plugin in my plugin https://www.ads-software.com/plugins/androapp/ to get mobile app for any wordpress site.
but hitting wp-json/posts gives this below error for some time zone(you can test with UTC +5:30
<b>Fatal error</b>: Uncaught exception ‘Exception’ with message ‘DateTimeZone::__construct(): Unknown or bad timezone (Etc/GMT+5.5)’ in /home/kanthala/public_html/wp-content/plugins/json-rest-api/plugin.php:672
Stack trace:
#0 /home/kanthala/public_html/wp-content/plugins/json-rest-api/plugin.php(672): DateTimeZone->__construct(‘Etc/GMT+5.5’)
#1 /home/kanthala/public_html/wp-content/plugins/json-rest-api/lib/class-wp-json-posts.php(584): json_get_timezone()
#2 /home/kanthala/public_html/wp-content/plugins/json-rest-api/lib/class-wp-json-posts.php(188): WP_JSON_Posts->prepare_post(Array, ‘view’)
#3 [internal function]: WP_JSON_Posts->get_posts(Array, ‘view’, ‘post’, 1)
#4 /home/kanthala/public_html/wp-content/plugins/json-rest-api/lib/class-wp-json-server.php(444): call_user_func_array(Array, Array)
#5 /home/kanthala/public_html/wp-content/plugins/json-rest-api/lib/class-wp-json-server.php(248): WP_JSON_Server->dispatch()
#6 /home/kanthala/public_html/wp-content/plugins/json-rest-api/plugin.php(182): WP_JSON_Server->serve_request in <b>/home/kanthala/public_html/wp-content/plugins/json-rest-api/plugin.php</b> on line <b>672</b>This error is coming while trying to use this method DateTimeZone, Can you please look into this and use some other method instead of this one. or some other fix. many of my clients are facing this issue, can you please rectify it fast.
I would really appreciate it
- The topic ‘Error for few timezones because of DateTimeZone function’ is closed to new replies.