21 lines
372 B
PHP
21 lines
372 B
PHP
|
<?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) {
|
||
|
}
|
||
|
|
||
|
}
|