public static long parseLockTimeStr(String lockTimeStr) throws ParseException {
  if (lockTimeStr.indexOf("/") != -1) {
    SimpleDateFormat format=new SimpleDateFormat("yyyy/MM/dd");
    Date date=format.parse(lockTimeStr);
    return date.getTime() / 1000;
  }
  return Long.parseLong(lockTimeStr);
}

public static long parseLockTimeStr ( String lockTimeStr ) throws ParseException { if ( lockTimeStr . indexOf ( "/" ) != - 1 ) { SimpleDateFormat format = new SimpleDateFormat ( "yyyy/MM/dd" ) ; Date date = format . parse ( lockTimeStr ) ; return date . getTime ( ) / 1000 ; } return Long . parseLong ( lockTimeStr ) ; }
parses the string either as a whole number of blocks , or if it contains slashes as a yyyy / mm / dd format date and returns the lock time in wire format .
