PGN Through API Has End Time Before Start Time

Sort:
gammonheck

Game `7a93b1c4-2fad-11ec-9f26-09ff3c010001` has an end time before start time in the pgn when viewing through the api. It is important to note this was a 1+1 game where I gave my opponent a lot of extra time. Also, I think it is possible that we had a game abort by accident due to inactivity. Then we restarted the game. So perhaps the end time is from the accidental aborted game?

Reproduction:

  1. Go to https://api.chess.com/pub/player/gammonheck/games/2021/10
  2. Search in page for 7a93b1c4-2fad-11ec-9f26-09ff3c010001
  3. Note that the end time is before the start time.
gammonheck

[Event "Live Chess"]
[Site "Chess.com"]
[Date "2021.10.18"]
[Round "-"]
[White "abell06"]
[Black "gammonheck"]
[Result "1-0"]
[CurrentPosition "4r2k/6p1/3R1pPp/p6P/P2P1Q1K/7B/8/8 w - -"]
[Timezone "UTC"]
[ECO "A00"]
[ECOUrl "https://www.chess.com/openings/Van-Geet-Opening-1...Nc6-2.d4-d5"]
[UTCDate "2021.10.18"]
[UTCTime "01:00:16"]
[WhiteElo "417"]
[BlackElo "638"]
[TimeControl "60+1"]
[Termination "abell06 won by resignation"]
[StartTime "01:00:16"]
[EndDate "2021.10.18"]
[EndTime "00:59:09"]
[Link "https://www.chess.com/game/live/28257009925"]

1. d4 {[%clk 0:01:01]} 1... d5 {[%clk 0:01:01]} 2. Nc3 {[%clk 0:03:39.1]} 2... Nc6 {[%clk 0:01:00.4]} 3. e3 {[%clk 0:06:03]} 3... Bf5 {[%clk 0:00:59.6]} 4. f4 {[%clk 0:07:59.5]} 4... e6 {[%clk 0:00:58.7]} 5. a3 {[%clk 0:09:12.9]} 5... Bd6 {[%clk 0:00:55.3]} 6. Nf3 {[%clk 0:09:49.7]} 6... Nf6 {[%clk 0:00:55.7]} 7. h3 {[%clk 0:09:45.2]} 7... O-O {[%clk 0:00:55.6]} 8. g4 {[%clk 0:09:43.7]} 8... Bg6 {[%clk 0:00:53.8]} 9. b4 {[%clk 0:09:33.7]} 9... Ne4 {[%clk 0:00:45.7]} 10. Nxe4 {[%clk 0:09:28]} 10... Bxe4 {[%clk 0:00:46.6]} 11. Bg2 {[%clk 0:09:13.7]} 11... Bxf3 {[%clk 0:00:44.7]} 12. Bxf3 {[%clk 0:09:12]} 12... Qe7 {[%clk 0:00:42.4]} 13. g5 {[%clk 0:09:08]} 13... b6 {[%clk 0:00:41]} 14. h4 {[%clk 0:09:02.7]} 14... a5 {[%clk 0:00:40.4]} 15. b5 {[%clk 0:08:56.7]} 15... Na7 {[%clk 0:00:39.4]} 16. a4 {[%clk 0:08:55]} 16... c6 {[%clk 0:00:38]} 17. bxc6 {[%clk 0:08:47.9]} 17... Nxc6 {[%clk 0:00:38.9]} 18. h5 {[%clk 0:08:41.4]} 18... f6 {[%clk 0:00:37]} 19. g6 {[%clk 0:08:29]} 19... h6 {[%clk 0:00:33.2]} 20. f5 {[%clk 0:08:20]} 20... exf5 {[%clk 0:00:32.6]} 21. Bxd5+ {[%clk 0:07:58.2]} 21... Kh8 {[%clk 0:00:27.2]} 22. Bxc6 {[%clk 0:07:33.3]} 22... Rac8 {[%clk 0:00:27.4]} 23. Bd5 {[%clk 0:07:22.6]} 23... f4 {[%clk 0:00:27.1]} 24. Rb1 {[%clk 0:06:57.2]} 24... fxe3 {[%clk 0:00:21.3]} 25. Rxb6 {[%clk 0:06:52]} 25... Rce8 {[%clk 0:00:15.7]} 26. Qf3 {[%clk 0:06:12.9]} 26... e2 {[%clk 0:00:10.9]} 27. Rf1 {[%clk 0:06:05.8]} 27... exf1=Q+ {[%clk 0:00:05.8]} 28. Kxf1 {[%clk 0:05:59.7]} 28... Qe1+ {[%clk 0:00:04.6]} 29. Kg2 {[%clk 0:05:46.8]} 29... Qxc1 {[%clk 0:00:05.5]} 30. Rxd6 {[%clk 0:05:28.7]} 30... Qxc2+ {[%clk 0:00:05.5]} 31. Kg3 {[%clk 0:05:23.2]} 31... Qe2 {[%clk 0:00:03.4]} 32. Qf4 {[%clk 0:04:59.8]} 32... Re3+ {[%clk 0:00:01.4]} 33. Kh4 {[%clk 0:04:50.5]} 33... Qg2 {[%clk 0:00:02.1]} 34. Bxg2 {[%clk 0:04:49.1]} 34... Rh3+ {[%clk 0:00:01.6]} 35. Bxh3 {[%clk 0:04:47.9]} 35... Re8 {[%clk 0:00:02.2]} 1-0

Bobcat

     just think! in no time We will be a head two own time quiet Lee

 

     Peter Paul marry & Barry Larry just Paul barrier Ann deer Abby wrote off/bed

Bobcat
gammonheck wrote:

Game `7a93b1c4-2fad-11ec-9f26-09ff3c010001` has an end time before start time in the pgn when viewing through the api. It is important to note this was a 1+1 game where I gave my opponent a lot of extra time. Also, I think it is possible that we had a game abort by accident due to inactivity. Then we restarted the game. So perhaps the end time is from the accidental aborted game?

 

Reproduction:

  1. Go to https://api.chess.com/pub/player/gammonheck/games/2021/10
  2. Search in page for 7a93b1c4-2fad-11ec-9f26-09ff3c010001
  3. Note that the end time is before the start time.
  4. Note that the end is after the last one to leave: Pay or stay-who will have Faith to "stay"5. out of Ten.

 

Martin_Stahl

Might be time zone related.

Here's what I get from the API, via browser

[StartTime "19:06:32"]
[EndDate "2021.10.01"]
[EndTime "19:08:53"]
gammonheck

@Martin_Stahl you are looking at the wrong game -- that is the first game in the response. Search in the page for "7a93b1c4-2fad-11ec-9f26-09ff3c010001" (step 2 in repro). 

Tricky_Dicky

I think 7a93b1c4-2fad-11ec-9f26-09ff3c010001 is a user ID not a game reference

Tricky_Dicky

Looks to be a bug. Server hiccup maybe?

https://www.chess.com/game/live/28257009925",
"pgn":"[Event \"Live Chess\"]
\n[Site \"Chess.com\"]\n[Date \"2021.10.18\"]
\n[Round \"-\"]\n[White \"abell06\"]
\n[Black \"gammonheck\"]\n[Result \"1-0\"]
\n[CurrentPosition \"4r2k/6p1/3R1pPp/p6P/P2P1Q1K/7B/8/8 w - -\"]
\n[Timezone \"UTC\"]\n[ECO \"A00\"]
\n[ECOUrl \"https://www.chess.com/openings/Van-Geet-Opening-1...Nc6-2.d4-d5\"]
\n[UTCDate \"2021.10.18\"]\n[UTCTime \"01:00:16\"]\n[WhiteElo \"417\"]
\n[BlackElo \"638\"]\n[TimeControl \"60+1\"]
\n[Termination \"abell06 won by resignation\"]
\n[StartTime \"01:00:16\"]\n[EndDate \"2021.10.18\"]
\n[EndTime \"00:59:09\"]\
bmacho

https://api.chess.com/pub/player/gammonheck/games/2021/10 57-th game here

https://www.chess.com/game/live/28257009925

https://www.chess.com/callback/live/game/28257009925

 

I believe that chess.com only stores end time and clock times (see last link that chess.com game viewer uses), and tries to figure out the start date from that, but it can't, since they don't store when friends give each other time. ( And it makes mathematically impossible to chess.com to replay their own bughouse games in the right move order, or to us to use the games for anything, train AI or build a database sad.png )

My guess is that they count the time increment only once when they calculate the game length from clock times, and it gives them a negative number ( e.g. (total time) - (times on the clocks at the end) = ( 60+60 start time + 35*1+35*1 increment time + 1*15 free time ) - ( 2 + 4*60 + 32 time on the clock ) = -69 secs for the game time, close enough.)

This theory is testable if you give a lot of time to your friend, and check if the start time is messed up.

stephen_33
bmacho wrote:

I believe that chess.com only stores end time and clock times (see last link that chess.com game viewer uses), and tries to figure out the start date from that, but it can't, since they don't store when friends give each other time. ...

Unfamiliar territory for me but while you're right about the endpoint giving an explicit field for the "end_time":1634518749 only, both start and end date-times are included in the pgn itself:-

[Date \"2021.10.18\"]
[Timezone \"UTC\"]
[UTCDate \"2021.10.18\"]
[UTCTime \"01:00:16\"]
[TimeControl \"60+1\"]
[StartTime \"01:00:16\"]
[EndDate \"2021.10.18\"]
[EndTime \"00:59:09\"]

stephen_33

Interestingly, when I decode the end time integer (1634518749) I obtain this...

tm_year=2021, tm_mon=10, tm_mday=18, tm_hour=1, tm_min=59, tm_sec=9, tm_wday=0, tm_yday=291, tm_isdst=1

I.e. the game actually ended at 01:59:09 (DST). So the question seems to be what's happening to shave an hour off the end time that appears in the pgn?

I think this may be related to why the timezone is shown as: Timezone \"UTC\" - shouldn't that show UTC+1, since daylight saving was in force in the US on that date?

bmacho

https://www.timeanddate.com/time/dst/2021.html

Either the server doesn't store the game start times, but calculates it with a faulty equation , or it does store, and this game is just a server glitch.