Skip to content

Commit

Permalink
Merge branch 'AlexBHarley-alexbharley-2860-UtcToUtcNow' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenba committed Feb 8, 2016
2 parents 0ce4169 + a1a6436 commit 962b917
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public string DoExport(string blobUri, bool whatIf)

//public bool DoImport(string blobUri)
//{
// Console.Write(String.Format("Starting Import Operation - {0}\n\r", DateTime.Now));
// Console.Write(String.Format("Starting Import Operation - {0}\n\r", DateTime.UtcNow));
// string requestGuid = null;
// bool importComplete = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private void CreateAllPerPackageReports()
{
Log.Info("CreateAllPerPackageReports");

DateTime before = DateTime.Now;
DateTime before = DateTime.UtcNow;

IList<string> packageIds = GetAllPackageIds();

Expand All @@ -146,7 +146,7 @@ private void CreateAllPerPackageReports()
});
});

string msg = $"CreateAllPerPackageReports complete {(DateTime.Now - before).TotalSeconds} seconds";
string msg = $"CreateAllPerPackageReports complete {(DateTime.UtcNow - before).TotalSeconds} seconds";

Log.Info(msg);
}
Expand Down Expand Up @@ -179,7 +179,7 @@ private void CreateDirtyPerPackageReports()
{
Log.Info("CreateDirtyPerPackageReports");

DateTime before = DateTime.Now;
DateTime before = DateTime.UtcNow;

IList<Tuple<string, int>> packageIds = GetPackageIds();

Expand Down Expand Up @@ -207,7 +207,7 @@ private void CreateDirtyPerPackageReports()
});
});

string msg = $"CreateDirtyPerPackageReports complete {(DateTime.Now - before).TotalSeconds} seconds";
string msg = $"CreateDirtyPerPackageReports complete {(DateTime.UtcNow - before).TotalSeconds} seconds";

Log.Info(msg);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ private int Replicate(string source, string destination, int batchSize, int expe
int originalKey = GetLastOriginalKey(destination);
Log.Trace("replicating records since {0}", originalKey);

DateTime before = DateTime.Now;
DateTime before = DateTime.UtcNow;
DownloadBatch batch = GetDownloadRecords(source, originalKey, batchSize);
DateTime after = DateTime.Now;
DateTime after = DateTime.UtcNow;
TimeSpan duration = after - before;

Log.Trace($"source query duration: {duration.TotalSeconds} seconds");
Expand Down
2 changes: 1 addition & 1 deletion src/NuGetGallery/Filters/CacheFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public override void OnActionExecuted(ActionExecutedContext filterContext)
TimeSpan cacheDuration = TimeSpan.FromSeconds(Duration);

cache.SetCacheability(HttpCacheability.Public);
cache.SetExpires(DateTime.Now.Add(cacheDuration));
cache.SetExpires(DateTime.UtcNow.Add(cacheDuration));
cache.SetMaxAge(cacheDuration);
cache.AppendCacheExtension("must-revalidate, proxy-revalidate");
}
Expand Down
2 changes: 1 addition & 1 deletion src/NuGetGallery/Services/FormsAuthenticationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void SignOut()
var cookie = context.Request.Cookies[ForceSSLCookieName];
if (cookie != null)
{
cookie.Expires = DateTime.Now.AddDays(-1d);
cookie.Expires = DateTime.UtcNow.AddDays(-1d);
context.Response.Cookies.Add(cookie);
}
}
Expand Down
16 changes: 8 additions & 8 deletions tests/NuGetGallery.Facts/Services/PackageServiceFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1695,7 +1695,7 @@ public void PublishPackageUpdatesIsAbsoluteLatestForPrereleasePackage()
var package = new Package
{
Version = "1.0.42-alpha",
Published = DateTime.Now,
Published = DateTime.UtcNow,
PackageRegistration = new PackageRegistration
{
Id = "theId",
Expand All @@ -1708,7 +1708,7 @@ public void PublishPackageUpdatesIsAbsoluteLatestForPrereleasePackage()
{
Version = "1.0.39",
PackageRegistration = package.PackageRegistration,
Published = DateTime.Now.AddDays(-1)
Published = DateTime.UtcNow.AddDays(-1)
};
package.PackageRegistration.Packages.Add(package39);
var packageRepository = new Mock<IEntityRepository<Package>>();
Expand All @@ -1728,7 +1728,7 @@ public void PublishPackageUpdatesIsAbsoluteLatestForPrereleasePackageWithOverloa
var package = new Package
{
Version = "1.0.42-alpha",
Published = DateTime.Now,
Published = DateTime.UtcNow,
PackageRegistration = new PackageRegistration
{
Id = "theId",
Expand All @@ -1741,7 +1741,7 @@ public void PublishPackageUpdatesIsAbsoluteLatestForPrereleasePackageWithOverloa
{
Version = "1.0.39",
PackageRegistration = package.PackageRegistration,
Published = DateTime.Now.AddDays(-1)
Published = DateTime.UtcNow.AddDays(-1)
};
package.PackageRegistration.Packages.Add(package39);
var packageRepository = new Mock<IEntityRepository<Package>>();
Expand All @@ -1762,7 +1762,7 @@ public void SetUpdateDoesNotSetIsLatestStableForAnyIfAllPackagesArePrerelease()
var package = new Package
{
Version = "1.0.42-alpha",
Published = DateTime.Now,
Published = DateTime.UtcNow,
IsPrerelease = true,
PackageRegistration = new PackageRegistration
{
Expand All @@ -1775,7 +1775,7 @@ public void SetUpdateDoesNotSetIsLatestStableForAnyIfAllPackagesArePrerelease()
{
Version = "1.0.39-beta",
PackageRegistration = package.PackageRegistration,
Published = DateTime.Now.AddDays(-1),
Published = DateTime.UtcNow.AddDays(-1),
IsPrerelease = true
};
package.PackageRegistration.Packages.Add(package39);
Expand All @@ -1796,7 +1796,7 @@ public void SetUpdateDoesNotSetIsLatestStableForAnyIfAllPackagesArePrereleaseWit
var package = new Package
{
Version = "1.0.42-alpha",
Published = DateTime.Now,
Published = DateTime.UtcNow,
IsPrerelease = true,
PackageRegistration = new PackageRegistration
{
Expand All @@ -1809,7 +1809,7 @@ public void SetUpdateDoesNotSetIsLatestStableForAnyIfAllPackagesArePrereleaseWit
{
Version = "1.0.39-beta",
PackageRegistration = package.PackageRegistration,
Published = DateTime.Now.AddDays(-1),
Published = DateTime.UtcNow.AddDays(-1),
IsPrerelease = true
};
package.PackageRegistration.Packages.Add(package39);
Expand Down

0 comments on commit 962b917

Please sign in to comment.