modify script to work with bsd date