I am trying to format a String into a date but getting java compiler error:
The fragment of code is:
String value = String.valueOf(entry.getValue());
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH);
//String dateInString = value;
SimpleDateFormat parse = new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy", Locale.ENGLISH);
if (isFirst){
Date date = parse.parse(value);
//Then I'll just put the date variable into a cell in the html table.
The error I am getting:
cannot find symbol
[javac] symbol : constructor SimpleDateFormat(java.lang.String,java.util.Locale)
[javac] location: class com.lb.base.util.extra.SimpleDateFormat
[javac] SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH);
[javac] ^
I get this for both times I am declaring new SimpleDateFormat. I have checked that import is not the issue. Quite confused to what it is then..why am I getting this 'cannot find symbol' error?
Copyright Notice:Content Author:「stretchr」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/22340643/java-compiler-issue-cannot-find-symbol