wikiki

 

/** 
     * 生成随机文件名:当前年月日时分秒+五位随机数 
     *  
     * @return 
     */  
    public static String getRandomFileName() {  
  
        SimpleDateFormat simpleDateFormat;  
  
        simpleDateFormat = new SimpleDateFormat("yyyyMMdd");  
  
        Date date = new Date();  
  
        String str = simpleDateFormat.format(date);  
  
        Random random = new Random();  
  
        int rannum = (int) (random.nextDouble() * (99999 - 10000 + 1)) + 10000;// 获取5位随机数  
  
        return rannum + str;// 当前时间  
    }

  

 

分类:

技术点:

相关文章:

  • 2021-10-10
  • 2021-12-12
  • 2021-12-06
  • 2021-12-06
  • 2021-10-20
  • 2021-11-11
  • 2021-11-21
  • 2021-09-14
猜你喜欢
  • 2021-12-06
  • 2021-12-06
  • 2021-09-13
  • 2021-12-06
  • 2021-09-13
  • 2021-11-11
  • 2021-10-07
相关资源
相似解决方案