Updated current date function to work correctly