Explorar o código

Update recipe_file_uploads.rst

xorg-robur %!s(int64=11) %!d(string=hai) anos
pai
achega
635a30f27e
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      Resources/doc/cookbook/recipe_file_uploads.rst

+ 1 - 1
Resources/doc/cookbook/recipe_file_uploads.rst

@@ -136,7 +136,7 @@ We then have the following methods in our ``Image`` class to manage file uploads
      * Updates the hash value to force the preUpdate and postUpdate events to fire
      */
     public function refreshUpdated() {
-        $this->setUpdated(date('Y-m-d H:i:s'));
+        $this->setUpdated(new \DateTime("now"));
     }
 
     // ... the rest of your class lives under here, including the generated fields