diff --git a/auth/db/auth.php b/auth/db/auth.php
index 931b4d2..fac077e 100644
--- a/auth/db/auth.php
+++ b/auth/db/auth.php
@@ -342,11 +342,11 @@ class auth_plugin_db extends auth_plugin_base {
                 $user = $this->get_userinfo_asobj($user);
 
                 // prep a few params
-                $user->username   = $username;
-                $user->modified   = time();
-                $user->confirmed  = 1;
-                $user->auth       = $this->authtype;
-                $user->mnethostid = $CFG->mnet_localhost_id;
+                $user->username     = $username;
+                $user->timemodified = time();
+                $user->confirmed    = 1;
+                $user->auth         = $this->authtype;
+                $user->mnethostid   = $CFG->mnet_localhost_id;
                 if (empty($user->lang)) {
                     $user->lang = $CFG->lang;
                 }
@@ -358,6 +358,7 @@ class auth_plugin_db extends auth_plugin_base {
                     echo "\t"; print_string('auth_dbreviveduser', 'auth_db', array('name'=>$user->username, 'id'=>$user->id)); echo "\n";
 
                 } else {
+                    $user->timecreated = $user->timemodified;
                     $id = $DB->insert_record ('user',$user); // it is truly a new user
                     echo "\t"; print_string('auth_dbinsertuser','auth_db',array('name'=>$user->username, 'id'=>$id)); echo "\n";
                     // if relevant, tag for password generation
