File tree 1 file changed +5
-1
lines changed
src/Symfony/Component/RateLimiter 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,11 @@ protected static function configureOptions(OptionsResolver $options): void
69
69
{
70
70
$ intervalNormalizer = static function (Options $ options , string $ interval ): \DateInterval {
71
71
try {
72
- return (new \DateTimeImmutable ())->diff (new \DateTimeImmutable ('+ ' .$ interval ));
72
+ // Force UTC timezone, because we don't want to deal with quirks happening when modifying dates in case
73
+ // there is a default timezone with DST. Read more here https://github.com/symfony/symfony/pull/58757
74
+ $ now = new \DateTimeImmutable ('now ' , new \DateTimeZone ('UTC ' ));
75
+
76
+ return $ now ->diff ($ now ->modify ('+ ' .$ interval ));
73
77
} catch (\Exception $ e ) {
74
78
if (!preg_match ('/Failed to parse time string \(\+([^)]+)\)/ ' , $ e ->getMessage (), $ m )) {
75
79
throw $ e ;
You can’t perform that action at this time.
0 commit comments