Updated script to write dates in %Y-%m-%d format