First off, the second parameter of setAttributeValue needs to be an Object. So your dateTimeHolder needs to be cast to Object. One way to do that is like:
entity1.setAttributeValue("LastModified", (Object) dateTimeHolder);
Also, your code is setting variables within your java program. To actually update the database, you need to do
engine.updateEntity(this, entity1);
Are you doing that?