+ 1

How can I get day from given date,month and year?

5th Jan 2023, 2:20 PM
Killiam Chances
Killiam Chances - avatar
1 Answer
+ 1
(⌐■_■) Killiam Chances , Hope this helps you SimpleDateFormat dtFmt1, dtFmt2; dtFmt1 = new SimpleDateFormat("EEEE yyyy.MM.dd"); dtFmt2 = new SimpleDateFormat("yyyy/MM/dd"); Date dNow = new Date(); System.out.println(dtFmt1.format(dNow)); try { Date dt = new Date(); dt = dtFmt2.parse("2022/12/18"); System.out.println(dtFmt1.format(dt)); } catch (Exception e) {} https://code.sololearn.com/ctEign4cHOmH
5th Jan 2023, 6:30 PM
SoloProg
SoloProg - avatar