I want to get the current month from the system as a string and also by using the java.sql.Date object.
I have tried the code below, but getMonth() is strike through by Eclipse:
java.util.Date date = new java.util.Date();
java.sql.Date sqlDate = new java.sql.Date( date.getMonth() );
Why is it is strike through?
The method is strike through in Eclipse because the method getMonth() is deprecated.
Besides if you want it as a String, you can use the class
SimpleDateFormatin order to transform the date to String.For example: