Another answer, when you have a machine where you do not have an internet connection and cannot log in, is here - https://dimitri.janczak.net/2019/07/13/trial-period-reset-of-visual-studio-community-edition/.
The files are on github - https://github.com/1Dimitri/VSCELicense/releases/tag/1.0.
From the readme file:
Download/clone this repository
Run PowerShell.exe as an Administrator
Import module:
Import-Module -Name X:\PATH\TO\VSCELicense
Get-VSCELicenseExpirationDate -Version VS2019
Set license expiration date to current date + 10 days
Set-VSCELicenseExpirationDate -Version VS2019 -AddDays 10