Java Parse Date parseDate(String d)

Here you can find the source of parseDate(String d)

Description

Parse date like "yyyy-MM-dd".

License

Apache License

Declaration

public static long parseDate(String d) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;

public class Main {
    public static String DATE_FORMAT = "yyyy-MM-dd";

    /**//from ww  w. j  a  v a2 s  .  co m
     * Parse date like "yyyy-MM-dd".
     */
    public static long parseDate(String d) {
        try {
            return new SimpleDateFormat(DATE_FORMAT).parse(d).getTime();
        } catch (Exception e) {
        }
        return 0;
    }
}

Related

  1. parseDate(String buildDate, SimpleDateFormat dateFormat)
  2. parseDate(String certDate)
  3. parseDate(String currDate)
  4. parseDate(String d)
  5. parseDate(String d)
  6. parseDate(String datastr, String pattern)
  7. parseDate(String date)
  8. parseDate(String date)
  9. parseDate(String date)