当前位置:网站首页>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);
}
}
边栏推荐
- Binary tree
- 聊聊 Dart 的空安全 (null safety) 特性
- The wonderful relationship between message queue and express cabinet
- Bit operation
- 云原生数据仓库AnalyticDB MySQL版用户手册
- Adults have only one main job, but they have to pay a price. I was persuaded to step back by personnel, and I cried all night
- Unity3D学习笔记5——创建子Mesh
- Dynamics 365 find field filtering
- Unity3D学习笔记4——创建Mesh高级接口
- 十四、数据库的导出和导入的两种方法
猜你喜欢
How to operate DTC community?
Technology at home and abroad people "see" the future of audio and video technology
Unity3D学习笔记5——创建子Mesh
Database daily question --- day 22: last login
【微服务|SCG】gateway整合sentinel
Binary tree
JMeter-接口自动化测试读取用例,执行并结果回写
微信论坛交流小程序系统毕业设计毕设(5)任务书
Unity3D学习笔记6——GPU实例化(1)
V20变频器手自动切换(就地远程切换)的具体方法示例
随机推荐
位运算(Bit Operation)
Network security - Eternal Blue
Oracle-数据库的备份与恢复
聊聊支付流程的设计与实现逻辑
One question per day - pat grade B 1002 questions
Cascade-LSTM: A Tree-Structured Neural Classifier for Detecting Misinformation Cascades-KDD2020
Network security CSRF
ArcGIS:矢量要素相同字段属性融合的两种方法
Brush question 6
Wechat forum exchange applet system graduation design completion (6) opening defense ppt
The 19th Zhejiang Provincial Collegiate Programming Contest 2022浙江省赛 F.EasyFix 主席树
Handling file exceptions
Adrnoid开发系列(二十五):使用AlertDialog创建各种类型的对话框
Matlab-SEIR传染病模型预测
STL标准模板库(Standard Template Library)一周学习总结
Unity3D学习笔记6——GPU实例化(1)
Inftnews | the wide application of NFT technology and its existing problems
三菱PLC slmp(mc)协议
Txt file virus
USB (十七)2022-04-15