8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d6d233b commit 489183aCopy full SHA for 489183a
src/Symfony/Component/Clock/CHANGELOG.md
@@ -1,6 +1,11 @@
1
CHANGELOG
2
=========
3
4
+6.4
5
+---
6
+
7
+ * Add $modifier argument to now() helper
8
9
6.3
10
---
11
src/Symfony/Component/Clock/Resources/now.php
@@ -18,8 +18,12 @@
18
* Note that you should prefer injecting a ClockInterface or using
19
* ClockAwareTrait when possible instead of using this function.
20
*/
21
- function now(): \DateTimeImmutable
+ function now(string $modifier = null): \DateTimeImmutable
22
{
23
+ if (null !== $modifier) {
24
+ return Clock::get()->now()->modify($modifier);
25
+ }
26
27
return Clock::get()->now();
28
}
29
0 commit comments