public static void main(String[] args) throws Exception { SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMdd"); String str = (sdf.format(new Date())); char[] dist = new char[str.length()]; for(int x = str.length() - 1, p = 0; x >= 0; x--){ dist[p++] = str.charAt(x); } BigInteger aa =new BigInteger("99999999"); BigInteger bb= new BigInteger(new String(dist)); BigInteger sub=aa.subtract(bb); System.out.println(sub.toString()); //System.out.println(new String(dist)); }
时间: 2024-10-13 09:42:22