user825: Is there a way to sort a PGN chess game by date and export the sorted games as a new PGN file?

user1967: You can do it with ChessBase:
http://chessbase-shop.com/en/products/chessbase12_download

user15049: The accepted answer does currently (2021) not work with the latest Scid versions. Bug? But it works with Scid vs PC:

In Scid vs PC, open the PGN database which you want to sort (File → Open).
Open the game list, if it is not visible already (Windows → Game List).
Create an empty Scid database via File → New (make sure it is a *.si4 database, not a *.pgn database). You should now see both database buttons below the game list.
Select the PGN database by clicking its button.
Sort the PGN database by your desired criteria. You can do that directly in the game list by clicking on the column headers, or by doing it via Tools → Maintenance → Sort Database (you can reset any sorting by right-clicking a column header in the game list and choosing Reset).
Drag-drop the button of the sorted PGN database on the button of the empty Scid database. This imports all games, sorted in the same order. Test it by resetting the sorting. The sorting should stay the same as in the sorted PGN database.
Finally export the Scid database to a new PGN database using Tools → Export All Filter Games → Export Filter to PGN. I recommend to not set the encoding to utf-8, I encountered problems in other databases when I did that.

Voilà

user2001: I am sure there are many programs that include this functionality. I would be surprised if SCID (http://scid.sourceforge.net/) did not have it. There should be one or more online services that provide this function. In the end of the day, you can write your own script in e.g. Python that does this easily and nicely. The trick is that some games appear as duplicates in less well maintained PGN files. Another trick is that some games are missing certain annotation fields. Some fields could also be filled in with incorrect type of data or simply be empty. So if you go down the road of writing your own scripts, consider writing quality check scripts that make sure the PGN format is followed and that the information is complete.

user103: I have not tried this myself, but there is a forum post on chess.com that has instructions on how to do this in SCID (http://www.chess.com/forum/view/help-support/sorting-a-pgn)

Make an empty scid database
Import your games
Do database maintenance - Sort by date
Export your databse to PGN


825: <p>Is there a way to sort a PGN chess game by date and export the sorted games as a new PGN file?</p>
 1967: <p>You can do it with ChessBase:
<a href="http://chessbase-shop.com/en/products/chessbase12_download" rel="nofollow">http://chessbase-shop.com/en/products/chessbase12_download</a></p>
 15049: <p>The accepted answer does currently (2021) not work with the latest Scid versions. Bug? But it works with Scid vs PC:</p>
<ul>
<li>In Scid vs PC, open the PGN database which you want to sort (<em>File</em> → <em>Open</em>).</li>
<li>Open the game list, if it is not visible already (<em>Windows</em> → <em>Game List</em>).</li>
<li>Create an empty Scid database via <em>File</em> → <em>New</em> (make sure it is a <code>*.si4</code> database, not a <code>*.pgn</code> database). You should now see both database buttons below the game list.</li>
<li>Select the PGN database by clicking its button.</li>
<li>Sort the PGN database by your desired criteria. You can do that directly in the game list by clicking on the column headers, or by doing it via <em>Tools</em> → <em>Maintenance</em> → <em>Sort Database</em> (you can reset any sorting by right-clicking a column header in the game list and choosing <em>Reset</em>).</li>
<li>Drag-drop the button of the sorted PGN database on the button of the empty Scid database. This imports all games, sorted in the same order. Test it by resetting the sorting. The sorting should stay the same as in the sorted PGN database.</li>
<li>Finally export the Scid database to a new PGN database using <em>Tools</em> → <em>Export All Filter Games</em> → <em>Export Filter to PGN</em>. I recommend to not set the encoding to utf-8, I encountered problems in other databases when I did that.</li>
</ul>
<p>Voilà</p>
 2001: <p>I am sure there are many programs that include this functionality. I would be surprised if SCID (<a href="http://scid.sourceforge.net/" rel="nofollow">http://scid.sourceforge.net/</a>) did not have it. There should be one or more online services that provide this function. In the end of the day, you can write your own script in e.g. Python that does this easily and nicely. The trick is that some games appear as duplicates in less well maintained PGN files. Another trick is that some games are missing certain annotation fields. Some fields could also be filled in with incorrect type of data or simply be empty. So if you go down the road of writing your own scripts, consider writing quality check scripts that make sure the PGN format is followed and that the information is complete.</p>
 103: <p>I have not tried this myself, but there is a forum post on chess.com that has instructions on how to do this in SCID (<a href="http://www.chess.com/forum/view/help-support/sorting-a-pgn" rel="noreferrer">http://www.chess.com/forum/view/help-support/sorting-a-pgn</a>)</p>

<ol>
<li>Make an empty scid database</li>
<li>Import your games</li>
<li>Do database maintenance - Sort by date</li>
<li>Export your databse to PGN</li>
</ol>
