import java.util.*;
import java.lang.*;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Calendar;
// The main method must be in a class named "Main".
class Main {
public static void main(String[] args)throws Exception {
String sDate1="2023-07-12";
Date date1=new SimpleDateFormat("yyyy-MM-dd").parse(sDate1);
Calendar c = Calendar.getInstance();
c.setTime(date1);
int dayOfMonth = c.get(Calendar.DAY_OF_MONTH);
System.out.println(dayOfMonth);
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: