This is my code:
package dateTime;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date;
public class GetCurrentDateTime {
public static void main(String[] args) {
LocalDate localDate = LocalDate.now();
String date = DateTimeFormatter.ofPattern("yyyy/MM/dd").format(localDate);
log.info("The date is "+date);
vars.put("currentDate",date);
}
}
I tried above code in beanshell, JSR223 pre-processor or post processor but not able to use it further.