We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent df7e50e commit 94fe571Copy full SHA for 94fe571
src/Type/DateTimeValue.php
@@ -4,6 +4,7 @@
4
5
namespace SimpleSAML\XML\Type;
6
7
+use DateTimeImmutable;
8
use DateTimeInterface;
9
use SimpleSAML\XML\Assert\Assert;
10
use SimpleSAML\XML\Exception\SchemaViolationException;
@@ -53,4 +54,13 @@ public static function fromDateTime(DateTimeInterface $value): static
53
54
{
55
return new static($value->format(static::DATETIME_FORMAT));
56
}
57
+
58
59
+ /**
60
+ * @return \DateTimeImmutable
61
+ */
62
+ public function toDateTime(): DateTimeImmutable
63
+ {
64
+ return new DateTimeImmutable($this->getValue());
65
+ }
66
0 commit comments