diff --git a/src/NuGet.Core/NuGet.Packaging.Extraction/Strings.Designer.cs b/src/NuGet.Core/NuGet.Packaging.Extraction/Strings.Designer.cs
index da2b19bfea1..0f8286f277c 100644
--- a/src/NuGet.Core/NuGet.Packaging.Extraction/Strings.Designer.cs
+++ b/src/NuGet.Core/NuGet.Packaging.Extraction/Strings.Designer.cs
@@ -1960,7 +1960,7 @@ internal class Strings {
}
///
- /// Looks up a localized string similar to Last write timestamp for '{0}' changed from '{1}' to '{2}' because the zip file format does not support timestamp values before 1980 or after 2107..
+ /// Looks up a localized string similar to File '{0}' was last modified on '{1}', which is out of range of what the zip format supports. Using '{2}' instead..
///
internal static string ZipFileTimeStampModified
{
diff --git a/src/NuGet.Core/NuGet.Packaging.Extraction/Strings.resx b/src/NuGet.Core/NuGet.Packaging.Extraction/Strings.resx
index c5052346484..0ab4f708cd3 100644
--- a/src/NuGet.Core/NuGet.Packaging.Extraction/Strings.resx
+++ b/src/NuGet.Core/NuGet.Packaging.Extraction/Strings.resx
@@ -866,8 +866,8 @@ Valid from:
0 - property name
- Last write timestamp for '{0}' changed from '{1}' to '{2}' because the zip file format does not support timestamp values before 1980 or after 2107.
- 0 - Entry name
+ File '{0}' was last modified on '{1}', which is out of range of what the zip format supports. Using '{2}' instead.
+ 0 - File name
1 - Original last write timestamp
2 - Updated last write timestamp
diff --git a/src/NuGet.Core/NuGet.Packaging/PackageCreation/Authoring/PackageBuilder.cs b/src/NuGet.Core/NuGet.Packaging/PackageCreation/Authoring/PackageBuilder.cs
index 8f4d1341ff1..2e4ead016a7 100644
--- a/src/NuGet.Core/NuGet.Packaging/PackageCreation/Authoring/PackageBuilder.cs
+++ b/src/NuGet.Core/NuGet.Packaging/PackageCreation/Authoring/PackageBuilder.cs
@@ -925,7 +925,7 @@ private ZipArchiveEntry CreatePackageFileEntry(ZipArchive package, string entryN
}
else if (timeOffset.UtcDateTime > ZipFormatMaxDate)
{
- warningMessage.AppendLine(StringFormatter.ZipFileTimeStampModified(entryName, timeOffset.DateTime.ToShortDateString(), ZipFormatMinDate.ToShortDateString()));
+ warningMessage.AppendLine(StringFormatter.ZipFileTimeStampModified(entryName, timeOffset.DateTime.ToShortDateString(), ZipFormatMaxDate.ToShortDateString()));
entry.LastWriteTime = ZipFormatMaxDate;
}
else
diff --git a/src/NuGet.Core/NuGet.Packaging/Strings.Designer.cs b/src/NuGet.Core/NuGet.Packaging/Strings.Designer.cs
index e6cd0151ef9..67019a7ea92 100644
--- a/src/NuGet.Core/NuGet.Packaging/Strings.Designer.cs
+++ b/src/NuGet.Core/NuGet.Packaging/Strings.Designer.cs
@@ -1960,7 +1960,7 @@ internal class Strings {
}
///
- /// Looks up a localized string similar to Last write timestamp for '{0}' changed from '{1}' to '{2}' because the zip file format does not support timestamp values before 1980 or after 2107..
+ /// Looks up a localized string similar to File '{0}' was last modified on '{1}', which is out of range of what the zip format supports. Using '{2}' instead..
///
internal static string ZipFileTimeStampModified {
get {
diff --git a/src/NuGet.Core/NuGet.Packaging/Strings.resx b/src/NuGet.Core/NuGet.Packaging/Strings.resx
index c5052346484..0ab4f708cd3 100644
--- a/src/NuGet.Core/NuGet.Packaging/Strings.resx
+++ b/src/NuGet.Core/NuGet.Packaging/Strings.resx
@@ -866,8 +866,8 @@ Valid from:
0 - property name
- Last write timestamp for '{0}' changed from '{1}' to '{2}' because the zip file format does not support timestamp values before 1980 or after 2107.
- 0 - Entry name
+ File '{0}' was last modified on '{1}', which is out of range of what the zip format supports. Using '{2}' instead.
+ 0 - File name
1 - Original last write timestamp
2 - Updated last write timestamp
diff --git a/test/NuGet.Core.Tests/NuGet.Packaging.Test/PackageBuilderTest.cs b/test/NuGet.Core.Tests/NuGet.Packaging.Test/PackageBuilderTest.cs
index 0802518842c..3dbd5e470af 100644
--- a/test/NuGet.Core.Tests/NuGet.Packaging.Test/PackageBuilderTest.cs
+++ b/test/NuGet.Core.Tests/NuGet.Packaging.Test/PackageBuilderTest.cs
@@ -3073,7 +3073,7 @@ public void PackageBuilder_CorrectLastWriteTimeBeforeYear1980_Succeeds()
Assert.True(numberOfDateCorrectedFiles == 5);
Assert.Equal(innerLogger.LogMessages.Count, 1);
string[] logMessages = innerLogger.LogMessages.First().Message.Split('\n');
- Assert.Equal(logMessages.Count(l => l.Contains("because the zip file format does not support timestamp values")), 5);
+ Assert.Equal(logMessages.Count(l => l.Contains("which is out of range of what the zip format supports.")), 5);
}
}
@@ -3164,7 +3164,7 @@ public void PackageBuilder_CorrectTestWriteTimeAfterYear2107_Succeeds()
Assert.True(numberOfDateCorrectedFiles == 5);
Assert.Equal(innerLogger.LogMessages.Count, 1);
string[] logMessages = innerLogger.LogMessages.First().Message.Split('\n');
- Assert.Equal(logMessages.Count(l => l.Contains("because the zip file format does not support timestamp values")), 5);
+ Assert.Equal(logMessages.Count(l => l.Contains("which is out of range of what the zip format supports.")), 5);
}
}