How to get the current time in YYYY-MM-DD HH:MI:Sec.Millisecond format in Java? September 8, 2022 by Tarik SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");