Changed time() to date()