Browse Source

Update recipe_file_uploads.rst

xorg-robur 11 năm trước cách đây
mục cha
commit
635a30f27e
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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