Untitled
unknown
plain_text
3 years ago
514 B
8
Indexable
String date_string = "Sun Oct 30 16:37:10 GMT 2022";
try{
date = new SimpleDateFormat("yy-MM-dd hh:mm", Locale.getDefault()).parse(date_string);
}
catch (ParseException e){
System.out.println(e.getMessage());
}
Calendar cal = Calendar.getInstance();
cal.setTime(date);
System.out.println("day of year: " + cal.get(Calendar.DAY_OF_YEAR)
+ "\n day of month: " + cal.get(Calendar.DAY_OF_MONTH)
+ "\n etc..");Editor is loading...