move get date code inside take snapshot function so the date and time is set correctly