How To Convert A String To A Date Object #43
How to convert a String to a Date object?
This multiple choice question (MCQ) is related to the book/course
gs gs128 Java.
It can also be found in
gs gs128 Java Data Types Variables Arrays - Java Data Type - Date & TimeZone - Quiz No.1.
How to convert a String to a Date object?
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); sdf.parse(new Date());SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); sdf.format(new Date());SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); new Date().parse();SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); new Date().format();