feat: implement now epoch
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -15,6 +15,10 @@ use DateTimeZone;
|
||||
|
||||
final class Timestamp {
|
||||
|
||||
public static function now(): int {
|
||||
return self::toEpoch(new DateTimeImmutable('now'));
|
||||
}
|
||||
|
||||
public static function normalize(mixed $value): ?int {
|
||||
if ($value instanceof DateTimeInterface) {
|
||||
return self::toEpoch($value);
|
||||
|
||||
Reference in New Issue
Block a user