# HG changeset patch # User Mike Becker # Date 1776362348 -7200 # Node ID d4f19182fdc23375f8592627f44d5955746b0e8d # Parent 685af47592b5cb3bf795a262e53b5032d055e0b8 add clock times to PGN output resolves #815 diff -r 685af47592b5 -r d4f19182fdc2 src/chess/pgn.c --- a/src/chess/pgn.c Thu Apr 16 19:49:16 2026 +0200 +++ b/src/chess/pgn.c Thu Apr 16 19:59:08 2026 +0200 @@ -205,8 +205,15 @@ } else { fprintf(stream, "%s", gamestate->moves[i].string); } - - // TODO: move time and maybe other comments + + /* add clock times when the game was under time control */ + if (gameinfo->timecontrol) { + char clkstr[16]; + unsigned clkmv = i + 2; /* time for the next move! */ + uint16_t clk = remaining_movetime2(gameinfo, gamestate, clkmv); + print_clk(clk, clkstr, true); + fprintf(stream, " {[%%clk %s]}", clkstr); + } /* line break every 10 half-moves */ if ((i+1) % 10) {