当前位置:网站首页>How to generate unique file names
How to generate unique file names
2022-07-07 23:16:00 【codepig16】
Mode one
Generate a five digit random number plus the month, day, minute and second of the current time
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;
public class MyUtil {
public static void main(String[] args) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
Random random = new Random();
String unique = random.nextInt(89999 + 10000) + simpleDateFormat.format(new Date());
System.out.println(unique);
}
}
边栏推荐
- USB(十六)2022-04-28
- php 使用阿里云存储
- Adrnoid开发系列(二十五):使用AlertDialog创建各种类型的对话框
- oc 可变參数传递
- Binary tree
- JMeter-接口自动化测试读取用例,执行并结果回写
- Byte hexadecimal binary understanding
- Handling file exceptions
- When copying something from the USB flash disk, an error volume error is reported. Please run CHKDSK
- ArcGIS: field assignment_ The attribute table field calculator assigns values to fields based on conditions
猜你喜欢

Wechat forum exchange applet system graduation design completion (6) opening defense ppt

Matlab 信号处理【问答随笔·2】

Innovation today | five key elements for enterprises to promote innovation
![[record of question brushing] 3 Longest substring without duplicate characters](/img/44/1cd8128d93c9c273e0f4718d84936e.png)
[record of question brushing] 3 Longest substring without duplicate characters

Brush question 3

Wechat forum exchange applet system graduation design completion (4) opening report

Brush question 4

微信论坛交流小程序系统毕业设计毕设(4)开题报告

Talk about the design and implementation logic of payment process

成年人只有一份主业是要付出代价的,被人事劝退后,我哭了一整晚
随机推荐
Bit operation
十三、系统优化
About idea cannot find or load the main class
UE4_UE5结合罗技手柄(F710)使用记录
Talk about the design and implementation logic of payment process
Cascade-LSTM: A Tree-Structured Neural Classifier for Detecting Misinformation Cascades-KDD2020
What are the similarities and differences between smart communities and smart cities
Locate to the bottom [easy to understand]
网络安全-安装CentOS
14、 Two methods of database export and import
网络安全-联合查询注入
Quelles sont les similitudes et les différences entre les communautés intelligentes et les villes intelligentes?
Gee (III): calculate the correlation coefficient between two bands and the corresponding p value
微信论坛交流小程序系统毕业设计毕设(7)中期检查报告
USB(十六)2022-04-28
漏洞复现----49、Apache Airflow 身份验证绕过 (CVE-2020-17526)
Wechat forum exchange applet system graduation design (5) assignment
2021-01-12
Network security sqlmap and DVWA explosion
Guessing game (read data from file)