My old Garmin eTrex Venture HC has started to record the dates incorrectly (it's partying like it's 1999). The only advice I can find involves 'deep' resets of the device which all sounds like a faff and about as likely to work as 'have you tried switching it off and on again?' Anyway, as my day job is doing this sort of thing, I've written a script to correct the dates (the times are ok), which I thought I would share in case it helps anyone else.
fixdate.ps1:Param(
[Parameter(Mandatory=$true)]$GPXFile,
[Parameter(Mandatory=$true)]$NewDate
)
Copy-Item "$GPXFile" "$GPXFile.bak" -Force
$xdoc = New-Object System.Xml.XmlDocument
$xdoc.Load($GPXFile)
$xdoc."gpx"."trk"."trkseg"."trkpt"|ForEach-Object {
$_."time" = $_."time" -replace "^.{10}", "$NewDate"
}
$xdoc.Save($GPXFile)
To run it, start a Powershell window, cd to the directory where you've placed the script and call, e.g.: .\fixdate.ps1 'C:\gpxfiles\broken.gpx' '2019-07-02'
My apologies for the quality of the code to anyone with better Powershell skills than me