# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: moodle/backup/backuplib.php
--- moodle/backup/backuplib.php Base (1.247)
+++ moodle/backup/backuplib.php Locally Modified (Based On 1.247)
@@ -1367,6 +1367,7 @@
                 if ($user->mnethostid != $CFG->mnet_localhost_id && !empty($user->wwwroot)) {
                     fwrite ($bf,full_tag("MNETHOSTURL",4,false,$user->wwwroot));
                 }
+                fwrite ($bf,full_tag("TIMECREATED",4,false,$user->timecreated));
                 fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$user->timemodified));
 
                 /// write assign/override code for context_userid
Index: moodle/backup/restorelib.php
--- moodle/backup/restorelib.php Base (1.413)
+++ moodle/backup/restorelib.php Locally Modified (Based On 1.413)
@@ -3037,6 +3037,11 @@
                         $user->theme = '';
                     }
 
+                    //set time created
+                    if (empty($user->timecreated)) {
+                        $user->timecreated = time();
+                    }
+
                     //We are going to create the user
                     //The structure is exactly as we need
 
@@ -7159,6 +7164,9 @@
                         case "MNETHOSTURL":
                             $this->info->tempuser->mnethosturl = $this->getContents();
                             break;
+                        case "TIMECREATED":
+                            $this->info->tempuser->timecreated = $this->getContents();
+                            break;
                         case "TIMEMODIFIED":
                             $this->info->tempuser->timemodified = $this->getContents();
                             break;
