slince / shopify-api-php

:rocket: Shopify API Client for PHP
MIT License
128 stars 48 forks source link

Retrieve Orders with UTC false #76

Open Noido opened 4 years ago

Noido commented 4 years ago

@slince Hi i try retrieve orders so i put for sample :

$pagination = $client->getOrderManager()->paginate([ 'limit'=>250, 'created_at_min' =>'2020-04-20T00:00:00Z', 'created_at_max'=> '2020-04-20T23:59:59Z', 'status' => 'any' ]);

I got all orders of 2020-04-20 but i got also order like

2020-04-21 01:26:43.0 +02:00

So can you explain me how i can get only order between 00:00 and 23:59 UTC ?

When i test on https://mysite.myshopify.com/admin/api/2020-04/orders.json?created_at_max=2020-04-20T23%3A59%3A59Z&created_at_min=2020-04-20T00%3A00%3A00Z&limit=250

It works fine so problem must be with Shopify-api-php

Regards

slince commented 4 years ago

hello, can you modify the version of API you use and try again

$client = new Slince\Shopify\Client($credential, 'your-store.myshopify.com', [
    'metaCacheDir' => './tmp'
    'apiVersion' => '2020-04'
]);
Noido commented 4 years ago

Juste change in 04 but same problem

Thanks for help