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()
106106 *
107107 * @param mixed $value
108108 */
109- public function fromDateTime ($ value ): UTCDateTime | string
109+ public function fromDateTime ($ value ): UTCDateTime
110110 {
111111 // If the value is already a UTCDateTime instance, we don't need to parse it.
112112 if ($ value instanceof UTCDateTime) {
@@ -117,9 +117,7 @@ public function fromDateTime($value): UTCDateTime|string
117117 if (! $ value instanceof DateTimeInterface) {
118118 $ value = parent ::asDateTime ($ value );
119119 }
120- if (isset ($ this ->dateFormat )) {
121- return $ value ->format ($ this ->getDateFormat ());
122- }
120+
123121 return new UTCDateTime ($ value );
124122 }
125123
@@ -150,6 +148,9 @@ public function getDateFormat()
150148 /** @inheritdoc */
151149 public function freshTimestamp ()
152150 {
151+ if (isset ($ this ->dateFormat )) {
152+ return Date::now ();
153+ }
153154 return new UTCDateTime (Date::now ());
154155 }
155156
You can’t perform that action at this time.
0 commit comments