read and write dates