Fix datetime/timestamp attributes
Numerous fixes to data taking script