 +            # without checking if they allready exist in NL.
 +            # We set syncstatus to 'edited', so that it might be correctly synced next time.
 +            # The lastsync value is arbritary, and will be corrected on next iteration
-+            $sync->update( { 'syncstatus' => 'edited', 'lastsync' => '2016-11-12T14:05:22' } );
++            my $now = `date +"%Y-%m-%dT%T"`;
++            chomp($now);
++            $sync->update( { 'syncstatus' => 'edited', 'lastsync' => $now } );
 +        } elsif ($cause =~ /lnr finnes ikke i registeret/) {
 +            # Make sure syncstatus is 'new'
 +            $sync->update( { 'syncstatus' => 'new' } );
++        } elsif ($cause =~ /Mangler verdi for sist_endret/) {
++            my $now = `date +"%Y-%m-%dT%T"`;
++            chomp($now);
++            $sync->update( { 'lastsync' => $now } );
 +        } elsif ($cause =~ /SIST_ENDRET/) {
 +            # NL has different timestamp; returnin an error like this:
 +            #  endre: Uoverensstemmelse med gjeldende data i basen:

 =head2 _soap_to_koha_patron

 Convert a SOAP object of type "Laaner" into a hash that can be sent to AddMember or ModMember.
@@ -635,13 +698,13 @@ sub _koha_patron_to_soap {
             SOAP::Data->name( 'fnr_hash'    => $patron_attributes->{ 'fnr' } )->type( 'string' )->type( 'string' ),
             SOAP::Data->name( 'navn'        => $patron->surname . ', ' . $patron->firstname    )->type( 'string' ),
             SOAP::Data->name( 'sist_endret' => $sync->lastsync      )->type( 'string' ),

         'dateofbirth'  => scalar $cgi->param('fdato'),
         'cardnumber'   => scalar $cgi->param('lnr'),
         'userid'       => scalar $cgi->param('lnr'),
@@ -118,13 +119,12 @@ if ( $op && $op eq 'search' ) {
         'address2'     => scalar $cgi->param('p_adresse2'),
         'zipcode'      => scalar $cgi->param('p_postnr'),
         'city'         => scalar $cgi->param('p_sted'),
