danieledangeli / betfair-php

Betfair php library
http://danieledangeli.github.io/betfair-php
47 stars 30 forks source link

Locale does not work #11

Open apuestaya opened 9 years ago

apuestaya commented 9 years ago

I printed events result like this but time zone is for Europe/London.

[0] => Array ( [event] => Array ( [id] => 27417270 [name] => Carpi v Brescia [countryCode] => IT [timezone] => Europe/London [openDate] => 2015-04-18T13:00:00.000Z )

        [marketCount] => 8
    )

I checked API docummentation in Betfair website and i found i can change with LOCALE param. In your function getAllEventFilteredByEventTypeIds i added ->setLocale("ES"); for a spanish timezone but it still shows same result Europe/London.

public function getAllEventFilteredByEventTypeIds(array $eventTypeIds) { $marketFilter = $this->createMarketFilter(); $marketFilter->setEventTypeIds($eventTypeIds); $param = $this->createParam($marketFilter) ->setLocale("ES");

    return $this->adapter->adaptResponse(
        $this->apiNgRequest(self::API_METHOD_NAME, $param)
    );
}

Do you know how can i change language, timezone and country? I want deploy it in Colombia. Thank you for your help, API and you time. I hope contribute soon as possible when i get ideas after play with it. Alex

danieledangeli commented 9 years ago

yes, I think it should be done with the Locale. Let me check it, and I'll let you know asap. A contribution is also finding problems :-), so thanks :+1:

danieledangeli commented 8 years ago

Hello @apuestaya I was reading the docs and I was trying to manipulate the locale. After a while I've realised that:

https://api.developer.betfair.com/services/webapps/docs/display/1smk3cen4v3lu3yomq5qye0ni/Locale+Specification

Basically the locale it's not for the datetime stuff, but it's for the languages used into the descriptions (and they also suggest to be aware that not all the markets has it).

I'd like to suggest to you to built a propet DateTime object and the n convert it in your timezone ;-)

sportsbook123 commented 6 years ago

The timezone vs openDate part of the API is jacked. When it says tz = GMT the event is on GMT + 1, but for any other tz (including australia, US...) the event date is spot on GMT.