java高手进!生成一个13位的当前时间

生成一个13位的当前时间,例如:
1380511569663
然后再随机生成一个六位的数,例如:
356765
最后把他俩合在一起,这样的
最后变成一个字符串类型x=1380511569663356765

System.out.println(System.currentTimeMillis()+String.valueOf((1000000+1000000*Math.random())).substring(1, 7));
System.out.println(System.currentTimeMillis()+"-"+String.valueOf((1000000+1000000*Math.random())).substring(1, 7));

System.currentTimeMillis()是当前毫秒数,String.valueOf((1000000+1000000*Math.random())).substring(1, 7)是随机6位,中间加个-你看的比较明白追问

你这个好麻烦,final String x2=new Date().getTime()+""+(int)(Math.random()* 999999)
那个系统时间最高就是13位的么?可能15位么?组长给我的要求是15位的,我猜他弄错了

温馨提示:答案为网友推荐,仅供参考
相似回答