oliverdavies.uk/modules/opd_presentations/src/Date.php

21 lines
372 B
PHP
Raw Normal View History

2025-06-12 23:27:58 +01:00
<?php
declare(strict_types=1);
namespace Drupal\opd_presentations;
readonly final class Date {
public function toTimestamp(): int {
return $this->date->getTimestamp();
}
public static function fromString(string $date): self {
return new self(new \DateTimeImmutable($date));
}
private function __construct(private \DateTimeImmutable $date) {
}
}