File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ public function getQualifiedKeyName()
106
106
*
107
107
* @param mixed $value
108
108
*/
109
- public function fromDateTime ($ value ): UTCDateTime | string
109
+ public function fromDateTime ($ value ): UTCDateTime
110
110
{
111
111
// If the value is already a UTCDateTime instance, we don't need to parse it.
112
112
if ($ value instanceof UTCDateTime) {
@@ -117,9 +117,7 @@ public function fromDateTime($value): UTCDateTime|string
117
117
if (! $ value instanceof DateTimeInterface) {
118
118
$ value = parent ::asDateTime ($ value );
119
119
}
120
- if (isset ($ this ->dateFormat )) {
121
- return $ value ->format ($ this ->getDateFormat ());
122
- }
120
+
123
121
return new UTCDateTime ($ value );
124
122
}
125
123
@@ -150,6 +148,9 @@ public function getDateFormat()
150
148
/** @inheritdoc */
151
149
public function freshTimestamp ()
152
150
{
151
+ if (isset ($ this ->dateFormat )) {
152
+ return Date::now ();
153
+ }
153
154
return new UTCDateTime (Date::now ());
154
155
}
155
156
You can’t perform that action at this time.
0 commit comments