Please refactor this. Use the built in 'created_at' field. Also don't set time on the client side.