Site
Home / Forum / General Discussion / Nba dates off in response

Nba dates off in response


Posted: 04 Dec 2023 04:14
stwj


Posts: 1
Joined: 2023

not sure where to go with this finding but i have ran the endpoint https://www.thesportsdb.com/api/v1/json/########/eventsnextleague.php?id=4387 to generate the games for nba and i dont get any return for the in season tournement, which is almost over so not a big deal, but wanted to know if there was another way to access it. So instead i ran https://www.thesportsdb.com/api/v1/json/########/eventsseason.php?id=4387&s=2023-2024
which also wasnt able to find but i did notice that all of the game dates are off by 1 day. For example the response after i extracted the values i wanted looks like this
{
"idEvent": "1906906",
"strEvent": "Los Angeles Lakers vs Houston Rockets",
"dateEvent": "2023-12-03",
"strEventAlternate": "Houston Rockets @ Los Angeles Lakers",
"strResult": " Los Angeles Lakers Quarters:25 35 26 21 Houston Rockets Quarters:30 14 28 25 "
},
{
"idEvent": "1921411",
"strEvent": "Cleveland Cavaliers vs Orlando Magic",
"dateEvent": "2023-12-07",
"strEventAlternate": "Orlando Magic @ Cleveland Cavaliers",
"strResult": " Cleveland Cavaliers Quarters: Orlando Magic Quarters: "
},

but the game for the lakers was played 2023-12-02 as today is the 3rd and all games following quarter finals of in-season tournamnet resume 2023-12-06 not the 7th. I am curious to know if im doing something incorrect or if the data is just that way. Thanks for the time!

Posted: 04 Dec 2023 08:23

Ovokx

Posts: 1,768
Joined: 2020

take into account that all dates on the DB are UTC, so for events on the States, you may find differences in some cases due to the time zone difference

Posted: 04 Dec 2023 19:26

zag


Posts: 3,511
Joined: 2020

Yes use UTC times for all sports.

The timestamp field can be converted to other dates and times in your timezone.

Posted: 09 Dec 2023 23:24
uc0

Posts: 5
Joined: 2023

My use case for this site is simply for organizing my library of NBA games for Plex, so this presents a challenge for me as well. All the games files are labeled by date, and while the latest few years of NBA seasons on the site are dated in UTC, others are not.

I understand that it's an international site catering to users all over the world. However, every NBA game is listed and referred to by every other website that I've ever seen on the day of the event in the US, not UTC. There are no YouTube clips or news articles for the May 13, 2019 76ers/Raptors game because it was played on May 12.

Is using the date for the home country of a league something that could be considered on a league-by-league basis? Would appreciate any thoughts from admin or anyone else. Thanks

EDIT: And I'm browsing through other threads, as I'm sure this is has been discussed before. Please feel free to let me know of any threads that have already explained the in's and out's of this. So far, I haven't seen anything on the reasoning behind using UTC across the board.

Posted: 10 Dec 2023 19:59
curswine


Posts: 935
Joined: 2020

This website is not designed especially for plex/kodi etc. Any problems you have with a third party app like that should be taken up with the developer to account for UTC time.

uc0, zag
Posted: 11 Dec 2023 04:43
uc0

Posts: 5
Joined: 2023

Of course it's not, but my point is that if the data is organized using a methodology that is inaccurate, then it's not very useful to anyone regardless of what they're using it for.

Posted: 11 Dec 2023 07:27
curswine


Posts: 935
Joined: 2020

It is accurate to UTC times and dates.

Posted: 11 Dec 2023 09:32

zag


Posts: 3,511
Joined: 2020

Of course it's not, but my point is that if the data is organized using a methodology that is inaccurate, then it's not very useful to anyone regardless of what they're using it for.

Basically your both right

It's something I'm trying to work out but not easy.

Ideally I would have both a "timezone" setting on the website frontend and the API. That's the ultimate goal

Recently I've added local timeszones to the events and tv pages which is the first step for this. Lots more work to do...


Posted: 11 Dec 2023 10:26
uc0

Posts: 5
Joined: 2023

Of course it's not, but my point is that if the data is organized using a methodology that is inaccurate, then it's not very useful to anyone regardless of what they're using it for.

Basically your both right

It's something I'm trying to work out but not easy.

Ideally I would have both a "timezone" setting on the website frontend and the API. That's the ultimate goal

Recently I've added local timeszones to the events and tv pages which is the first step for this. Lots more work to do...

The challenge is that the local date where an event occurred is often used as a static reference, and not only in my lowly Plex filenames , but in how the game is referred to when it's written about by journalists, titles of yt/fb/tt/etc vids, and in these cases, localizing it to the user or to UTC is counter-productive because the local date is part of the identity of the event.

Just a thought; you could use something like "Game Day" to always refer to the local date of the event, agnostic of UTC or a user's local time. Then this could be available through the API completely separate from the event date/time. Instead of storing a second date with each record, you could require the UTC offset of the event when an event is added to the db, and get it programmatically. Not sure how well this would be adhered to in a community-driven db.

Hope this makes sense, I'm pretty tired.

And thanks for all of your work on this site, very cool and much appreciated.



Who is Online?

In total there are 68 users online :: 3 registered, 0 hidden and 65 guests (based on users active over the past 5 minutes) Most users ever online was 424 on Fri Nov 10, 2017 9:02 pm

About Us

Discussion forum for TheSportsDB.com site and related topics

Rules

- Be Polite
- Respect other users
- Always post log files with issues
- Try to be helpful
- No Piracy discussion

Showing 0 to 9 (Total: 9)