From 974247bd0f0e2daa53949f48c6efee920f701478 Mon Sep 17 00:00:00 2001 From: jjvdgeer Date: Thu, 15 Apr 2021 15:00:36 +0200 Subject: [PATCH] Don't use local time to avoid problems entering winter time (#204) --- src/Spring/Spring.Web/Caching/AspNetCache.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Spring/Spring.Web/Caching/AspNetCache.cs b/src/Spring/Spring.Web/Caching/AspNetCache.cs index 92588e12..98dbb240 100644 --- a/src/Spring/Spring.Web/Caching/AspNetCache.cs +++ b/src/Spring/Spring.Web/Caching/AspNetCache.cs @@ -287,7 +287,7 @@ namespace Spring.Caching } else { - DateTime absoluteExpiration = DateTime.Now.Add(timeToLive); + DateTime absoluteExpiration = DateTime.UtcNow.Add(timeToLive); _cache.Insert(GenerateKey(key), value, null, absoluteExpiration, Cache.NoSlidingExpiration, itemPriority, null); } }