I have a test that checks to see if a file upload was uploaded "today". I am checking the string by comparing it to a date object I am making via Javas SimpleDateFormat. This was working for a while until the site code changed and removed 0's from the day. Here is what I have below:
Date for this file is: 8/3/2016
Todays date is: 8/03/2016
Because of this zero in the day my assert no longer comes back as valid. I am currently using a contains() function to verify if the day was correct for a file upload.
I need to understand how to account for this missing zero in the day now. Any suggestions? My date date function is below. All I do is grab a string on the page and compare.
public static String currentDate(){
Date date = new Date();
String modifiedDate = new SimpleDateFormat("MM/dd/yyyy").format(date);
return modifiedDate;
}