Site
Home / Forum / Developers / Difficulties with the time of events.

Difficulties with the time of events.


Posted: 21 Feb 2021 14:26
toma
Posts: 1
Joined: 2023-01-09

Hi,

So, the time of an event is not that easy to find, first i check for a strTimestamp, if it's not there, there might be a combination of dateEvent and strTime. If that's there there it might be a day event, but there is also a strTimeLocal.

If we look at NASCAR (https://www.thesportsdb.com/Event/1083431) that's the only option to find the correct start time. It is set to '3:00 pm ET'. This is in a format that is hard to parse. For example PHP can't parse that as is

The format also does not match what you can expect when you edit the sport event on the weg, it indicates "Local Time HH-MM-SS".

Would it be possible to improve, i mean I can adapt to this Nascar events easily, but in other events the format might be different.

Posted: 22 Feb 2021 13:48
curswine
Posts: 868
Joined: 2020-06-17

Whoever set that NASCAR time has set it incorrectly.

I have updated it to the correct time and formatted it in the correct way.

@Zag, would it be possible to make it so that only the correctly formatted time entered is accepted so that it is uniform across the site?



Posted: 22 Feb 2021 16:28

zag
Posts: 3,329
Joined: 2020-03-23

Whoever set that NASCAR time has set it incorrectly.

I have updated it to the correct time and formatted it in the correct way.

@Zag, would it be possible to make it so that only the correctly formatted time entered is accepted so that it is uniform across the site?



Yes probably, the issue here is we have different sources for different sports and they all like to have time in different formats

One thing I have improved on the auto updated sports recently is adding a universal "strTimeStamp" field which should be standard. Its not available for manual events but I might be able to add it automatically.

https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations

I will have a look now. But yes all sports should be added with correct time in UTC and the local time (if wanted).

Posted: 22 Feb 2021 16:33

zag
Posts: 3,329
Joined: 2020-03-23

Trello todo list updated with

https://trello.com/b/PMumZYQg/thesportsdb

- Add ISO 8601 timestamp to manually created events
- Standardize the UTC and Local time inputs on the manual event form. Validate input.

Posted: 23 Feb 2021 19:09
toma
Posts: 1
Joined: 2023-01-09

Thanks guys!

Posted: 26 Feb 2021 21:17

zag
Posts: 3,329
Joined: 2020-03-23

OK thanks for pointing out this, it was important to get right.

- New event function to only accepts a standard time object.
- New event function to also create a timestamp string for all new events
- Edit event function only accepts standard time object. (both UTC and local event time inputs)
- Updated the importers to all have a timestamp

While this won't fix everything, it should fix it for new events going forward. I might go through and see if I can normalize the times on older events at some point.

Posted: 26 Feb 2021 21:45
toma
Posts: 1
Joined: 2023-01-09

Really, thanks guys! Amazing work.

Posted: 06 Mar 2021 23:14
toma
Posts: 1
Joined: 2023-01-09

Nascar event of today is back to the weird unparsable format.

Posted: 06 Mar 2021 23:51
curswine
Posts: 868
Joined: 2020-06-17

Nascar event of today is back to the weird unparsable format.

I'm guessing these were all added before Zag made it impossible to post in any other format.

You can either edit them yourself or wait until I get some time tomorrow and I'll change them to the correct format.

Posted: 07 Mar 2021 12:47
curswine
Posts: 868
Joined: 2020-06-17

I've now changed all of the 2021 events into the correct format.

Posted: 07 Mar 2021 13:55
toma
Posts: 1
Joined: 2023-01-09

ignore my last post, somehow this forum is happy to re-post my previous text somehow.

thanks for all the changes.

Posted: 07 Mar 2021 13:56
curswine
Posts: 868
Joined: 2020-06-17

ignore my last post, somehow this forum is happy to re-post my previous text somehow.

thanks for all the changes.


Yeah it does have a tendency to do that if you refresh a page after posting.

No problem, hopefully things are working for you now.


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 12 (Total: 12)