Answers for "how do I get a long representation of a date java"

2

get long from date java

String string_date = "12-December-2012";

SimpleDateFormat f = new SimpleDateFormat("dd-MMM-yyyy");
try {
    Date d = f.parse(string_date);
    long milliseconds = d.getTime();
} catch (ParseException e) {
    e.printStackTrace();
}
Posted by: Guest on March-28-2020

Code answers related to "how do I get a long representation of a date java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language