Closed KitaitiMakoto closed 3 years ago
Thanks for pointing this out @KitaitiMakoto it looks like we should omit the timezone information though, to be consistent with other WC API items that output datetime strings (WC orders and products do not seem to include the timezone indication in the string); the local timezone can be inferred from the WordPress REST API or the WC Status route.
I noticed how the timezone component is included in Memberships' own API docs. I need to check with my team about this change and the correct output. Meanwhile if you have more questions or feedback for us you are also very welcome to reach us over https://www.skyverge.com/contact/ -- thank you!
Thank you for the reply and pointing contact form! I will wait for this problem fixed.
どういたしまして!もんだいをおわびします。
Does closing mean this was fixed in the latest version?
hey @KitaitiMakoto for now we updated the docs to reflect the output that Memberships will give.
The plugin isn't using yet dates with regards to timezone unfortunately, the string its date functions return don't assume they will include a timezone information, nor there are methods to return DateTime
objects, which would make timezones less ambiguous.
The API was designed to reflect the same output. The dates would be in UTC and the local dates, while presenting the time in UTC, they have an offset that reflects the current WP site timezone (the information should be retrievable from an option).
There's certainly the intention to change this further and move towards well formed DateTime
objects and have more consistent API responses, but it's a breaking change that we can push perhaps with a new version of the API in the future.
If you have further feedback or questions for our team, we'd be very happy to address it: https://www.skyverge.com/contact/
Thank you!
Bug Description According to API reference, User Membership object has some datetime fields in the local time zone, such as
date_created
,start_date
,end_date
and so on. But those fields always have time zone indicator+00:00
that indicates UTC(GMT) time zone.Response in example for, for instance,
POST http://example.com/api/wc/v3/memberships/members
has:Here,
date_created
should have local time zone indicator but actually has+00:00
. The value differs fromdate_created_gmt
so it should not be in+00:00
time zone. My site with your plugin behaves like this.Could you append right time zone(
+08:00
for above example) or remove them?Environments