WP Rest API Wrong Time Calculated
-
Hi Guys
We use the Rest API to add new custom posts but we are finding that the posts are getting “Scheduled” instead of published. Here is the scenario…
Server Time Hardware Time = Australia/Brisbane
Server Time System Time = Australia/BrisbaneWordpress Time Zone = Australia/Brisbane
Sample Time from the WordPress General Settings Page.
Universal time (GMT) is 2017-02-23 22:00:00. Local time is 2017-02-24 08:00:00.
If we create a new post with the REST API before
- 10am Local time (Australia/Brisbane) it set the post to “Scheduled”
For example I insert a new post using the API at 2017-02-24 08:00:00 (Australia/Brisbane) it will schedule the post to 2017-02-24 18:00:00
As per these instructions https://v2.wp-api.org/reference/posts/ we are setting the “date” using the local time (Australia/Brisbane) when we create a post.
Any ideas why it’s doing this?
- The topic ‘WP Rest API Wrong Time Calculated’ is closed to new replies.