Error when using DateFormat and SimpleDateFormat
I am getting an error when using DateFormat and SimpleDateFormat:
[Sourced file: : Typed variable declaration : Class: SimpleDateFormat not found in namespace]
Code:
import java.util.*;
// Variables for reportQtr and year
SimpleDateFormat dtFmt = new SimpleDateFormat("MM/dd/yyyy"); // DateFormat dtFmt = new SimpleDateFormat("MM/dd/yyyy");
Calendar cal = Calendar.getInstance();
String date = dtFmt.format(cal.getTime());
I do not understand how this is not included in the java.util.* (calendar)
0
-
Try adding this import
import java.text.*;
0
Post is closed for comments.
Comments
1 comment