From b461c991e1b4e7d4aaa45a0b10e10d92e7b063c4 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Thu, 27 May 2021 21:13:47 +0200 Subject: [PATCH 1/2] Adding getCreatedDateTime() What about a convenience function that returns a \DateTime out of the box? --- src/Models/Images/Image.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Models/Images/Image.php b/src/Models/Images/Image.php index f0da687..45a645d 100644 --- a/src/Models/Images/Image.php +++ b/src/Models/Images/Image.php @@ -224,4 +224,9 @@ public function reload() { return HetznerAPIClient::$instance->images()->get($this->id); } + + public function getCreatedDateTime() + { + return new \DateTime($this->created); + } } From 330cf31df25068fbe6ecedeb831b06905c7882c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20K=C3=A4mmerling?= Date: Tue, 22 Jun 2021 06:52:14 +0200 Subject: [PATCH 2/2] Fix style --- src/Models/Images/Image.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Models/Images/Image.php b/src/Models/Images/Image.php index 45a645d..f54a7d6 100644 --- a/src/Models/Images/Image.php +++ b/src/Models/Images/Image.php @@ -224,7 +224,7 @@ public function reload() { return HetznerAPIClient::$instance->images()->get($this->id); } - + public function getCreatedDateTime() { return new \DateTime($this->created);