added code to retrieve system date