Details about Problem
Running nuget pack .nuspec fails with the message
"The DateTimeOffset specified cannot be converted into a Zip file timestamp."
It happens with nuget 4.6.2 for a .dll file that has LastWriteTime 31/12/1979 23:00:00 +00:00

NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe):
NuGet.exe
version (4.6.2.5055)
OS version (i.e. win10 v1607 (14393.321)):
Windows 10 v 1803 Build 17134.81
Worked before? If so, with which NuGet version:
Works with v. 4.5.1.4879
Detailed repro steps so we can see the same problem
Run nuget pack NuGetDateTimeOffsetIssue.nuspec in the attached sample project
on nuget.exe v. 4.6 or higher.
Or:
Make a class library that includes NuGet log4net.Ext.Json v. 1.2.15.14586
Run nuget spec <lib-name>
Run nuget pack <.nuspec>
Verbose Logs
~/Downloads ❯❯❯ ./nuget\(1\).exe pack -verbosity detailed C:/dev/.../authenticationhost.nuspec
NuGet Version: 4.6.2.5055
Attempting to build package from 'authenticationhost.nuspec'.
The DateTimeOffset specified cannot be converted into a Zip file timestamp.
Parameter name: value
System.ArgumentOutOfRangeException: The DateTimeOffset specified cannot be converted into a Zip file timestamp.
Parameter name: value
at System.IO.Compression.ZipArchiveEntry.set_LastWriteTime(DateTimeOffset value)
at NuGet.Packaging.PackageBuilder.CreatePart(ZipArchive package, String path, Stream sourceStream, DateTimeOffset lastWriteTime)
at NuGet.Packaging.PackageBuilder.WriteFiles(ZipArchive package, HashSet`1 filesWithoutExtensions)
at NuGet.Packaging.PackageBuilder.Save(Stream stream)
at NuGet.Commands.PackCommandRunner.BuildPackage(PackageBuilder builder, String outputPath)
at NuGet.Commands.PackCommandRunner.BuildFromNuspec(String path)
at NuGet.Commands.PackCommandRunner.BuildPackage()
at NuGet.CommandLine.PackCommand.ExecuteCommand()
at NuGet.CommandLine.Command.ExecuteCommandAsync()
at NuGet.CommandLine.Command.Execute()
at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)
Sample Project
NuGetDateTimeOffsetIssue.zip

After fix (PR is in review)
Input file for test:

Now this file modified in 1959 after packing looks like this:

Details about Problem
Running nuget pack .nuspec fails with the message
"The DateTimeOffset specified cannot be converted into a Zip file timestamp."It happens with nuget 4.6.2 for a .dll file that has
LastWriteTime31/12/1979 23:00:00 +00:00NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe):
NuGet.exe
version (4.6.2.5055)
OS version (i.e. win10 v1607 (14393.321)):
Windows 10 v 1803 Build 17134.81
Worked before? If so, with which NuGet version:
Works with v. 4.5.1.4879
Detailed repro steps so we can see the same problem
Run
nuget pack NuGetDateTimeOffsetIssue.nuspecin the attached sample projecton nuget.exe v. 4.6 or higher.
Or:
Make a class library that includes NuGet log4net.Ext.Json v. 1.2.15.14586
Run
nuget spec <lib-name>Run
nuget pack <.nuspec>Verbose Logs
Sample Project
NuGetDateTimeOffsetIssue.zip
After fix (PR is in review)
Input file for test:

Now this file modified in 1959 after packing looks like this:
