echo "select datetime(dateTime,'unixepoch','localtime'),dateTime,rain,rainRate
from archive order by rowid desc limit 20;" | sqlite3 weewx.sdb
From this, get the dateTime value of the most recent one, which is seconds since the epoch. The localtime representation is there to hopefully make this a little easier.
Note: this prints in 'newest at the top' reverse order, so be careful in the next step. See the 'desc(ending)' ? To print ascending order change 'desc' above to 'asc'.
echo "update archive set rain=0.01 where dateTime<=1476343000 and dateTime>=1476342000;" |
sqlite3 weewx.sdb
echo "select datetime(dateTime,'unixepoch','localtime'),dateTime,sum
from archive_day_rain order by rowid desc limit 20;" | sqlite3 weewx.sdb
echo "update archive_day_rain set sum=1.07 where dateTime=1476342000;" |
sqlite3 weewx.sdb