public static Long toMillisec(String datestring){
  Date date=parse(datestring);
  if (date == null) {
    return null;
  }
  return date.getTime();
}

public static Long toMillisec ( String datestring ) { Date date = parse ( datestring ) ; if ( date == null ) { return null ; } return date . getTime ( ) ; }
returns a long - millisecond value from a given string using the default simpledateformat for parsing .
