You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[ScheduleEvery(StandardMinute * 5)] // schedule every 5 minutes
53
-
```
54
-
55
22
## Utilities
56
23
57
24
There are also a few utility methods:
58
25
59
-
> ->add(AnyTime)->subtract(AnyTime): AnyTime
26
+
> ->add(Time)->subtract(Time): AnyTime
60
27
61
28
Add and subtract durations.
62
29
63
30
> ->toDateInterval(): DateInterval
64
31
65
32
Creates a date interval for use in other things.
66
33
67
-
## Conversions
68
-
69
-
If you need to change the conversion rates, create a new standard:
70
-
71
-
```php
72
-
class Mars implements \Withinboredom\Time\TimeAndSpaceInterface {
73
-
/// ... fill in the blanks
74
-
}
75
-
```
76
-
77
-
This can be (mis)used to allow for very short times in unit tests (to make a week pass by in literally microseconds).
78
-
79
34
## Units
80
35
81
36
- Nanoseconds
@@ -90,16 +45,11 @@ This can be (mis)used to allow for very short times in unit tests (to make a wee
90
45
91
46
> Why not months/years?
92
47
93
-
There's no set days in a month/year, so it's better to use `DateInterval` for those types of measures.
48
+
There's no set days in a month/year, so it’s better to use `DateInterval` for those types of measures.
94
49
95
50
> Why does this exist?
96
51
97
-
I don't
98
-
like [magic numbers](https://en.wikipedia.org/wiki/Magic_number_(programming)#:~:text=Magic%20numbers%20are%20common%20in%20programs%20across%20many,have%20such%20constants%20that%20identify%20the%20contained%20data.).
99
-
100
-
> Can I convert between standards?
101
-
102
-
Not yet.
52
+
I don’t like [magic numbers](https://en.wikipedia.org/wiki/Magic_number_(programming)#:~:text=Magic%20numbers%20are%20common%20in%20programs%20across%20many,have%20such%20constants%20that%20identify%20the%20contained%20data.).
0 commit comments