当前位置:网站首页>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)
- Network security sqlmap and DVWA explosion
- Unity3D学习笔记6——GPU实例化(1)
- When copying something from the USB flash disk, an error volume error is reported. Please run CHKDSK
- Cases of agile innovation and transformation of consumer goods enterprises
- 30讲 线性代数 第五讲 特征值与特征向量
- Introduction to redis and jedis and redis things
- 嵌入式音频开发中的两种曲线
- 统计电影票房排名前10的电影并存入还有一个文件
- The wonderful relationship between message queue and express cabinet
猜你喜欢
微信论坛交流小程序系统毕业设计毕设(8)毕业设计论文模板
Oracle-数据库的备份与恢复
【刷题记录】3. 无重复字符的最长子串
漏洞复现----49、Apache Airflow 身份验证绕过 (CVE-2020-17526)
UE4_UE5结合罗技手柄(F710)使用记录
JMeter-接口自动化测试读取用例,执行并结果回写
ArcGIS:字段赋值_属性表字段计算器(Field Calculator)依据条件为字段赋值
Wechat forum exchange applet system graduation design (5) assignment
Talk about the design and implementation logic of payment process
消息队列与快递柜之间妙不可言的关系
随机推荐
Install a new version of idea. Double click it to open it
Bit operation
Network security - information query of operating system
GEE(四):计算两个变量(影像)之间的相关性并绘制散点图
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
JMeter interface automated test read case, execute and write back result
Install Fedora under RedHat
定位到最底部[通俗易懂]
Adrnoid Development Series (XXV): create various types of dialog boxes using alertdialog
GEE(三):计算两个波段间的相关系数与相应的p值
The 19th Zhejiang Provincial Collegiate Programming Contest VP记录+补题
Dynamics 365 find field filtering
Exploratory data analysis of heartbeat signal
微信论坛交流小程序系统毕业设计毕设(1)开发概要
Unity3D学习笔记6——GPU实例化(1)
Lecture 30 linear algebra Lecture 5 eigenvalues and eigenvectors
Talk about the design and implementation logic of payment process
网络安全-钓鱼
聊聊支付流程的设计与实现逻辑
OC variable parameter transfer