betfair-php icon indicating copy to clipboard operation
betfair-php copied to clipboard

Locale does not work

Open apuestaya opened this issue 9 years ago • 3 comments

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

apuestaya avatar Apr 14 '15 22:04 apuestaya

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 avatar Apr 15 '15 13:04 danieledangeli

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 ;-)

danieledangeli avatar Jan 24 '16 12:01 danieledangeli

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.

sportsbook123 avatar Aug 09 '18 17:08 sportsbook123