| | |
| | | <?php |
| | | namespace JVBase\managers\SEO\render\DataType; |
| | | |
| | | use DateMalformedStringException; |
| | | |
| | | if (!defined('ABSPATH')) { |
| | | exit; |
| | | } |
| | |
| | | */ |
| | | protected string $date; |
| | | |
| | | /** |
| | | * @throws \DateMalformedStringException |
| | | */ |
| | | public function __construct(string $date) |
| | | { |
| | | $this->setDate($date); |
| | |
| | | return $this->date; |
| | | } |
| | | |
| | | /** |
| | | * @throws \DateMalformedStringException |
| | | */ |
| | | public function setDate(string $date):void |
| | | { |
| | | $time = new \DateTime(strtotime($date)); |
| | | $time = $time->format('c'); |
| | | $time = date('c', strtotime($date)); |
| | | if ($time){ |
| | | $this->date = $time; |
| | | } |