added correct timestamp calculation to sqlite db writer