class="java" name="code"> public String getNumId() { SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); Date now = new Date(); String nowString = sdf.format(now); Random random = new Random(); int rannum = (int) (random.nextDouble() * (99999 - 10000 + 1)) + 10000; return nowString + rannum; }