当前位置:网站首页>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);
}
}
边栏推荐
- 微信论坛交流小程序系统毕业设计毕设(2)小程序功能
- Oracle-数据库的备份与恢复
- Digital collections accelerated out of the circle, and marsnft helped diversify the culture and tourism economy!
- 消息队列与快递柜之间妙不可言的关系
- One question per day - pat grade B 1002 questions
- Wechat forum exchange applet system graduation design completion (4) opening report
- 嵌入式音频开发中的两种曲线
- OC variable parameter transfer
- Innovation today | five key elements for enterprises to promote innovation
- Network security - information query of operating system
猜你喜欢
Wechat forum exchange applet system graduation design completion (6) opening defense ppt
U盘拷贝东西时,报错卷错误,请运行chkdsk
PMP项目管理考试过关口诀-1
Wechat forum exchange applet system graduation design (3) background function
Wechat forum exchange applet system graduation design completion (8) graduation design thesis template
微信论坛交流小程序系统毕业设计毕设(3)后台功能
UE4_UE5全景相机
ArcGIS: field assignment_ The attribute table field calculator assigns values to fields based on conditions
USB(十五)2022-04-14
Wechat forum exchange applet system graduation design completion (1) development outline
随机推荐
Dynamics 365 find field filtering
14、 Two methods of database export and import
Network security -beef
Brush question 4
统计电影票房排名前10的电影并存入还有一个文件
Wechat forum exchange applet system graduation design completion (4) opening report
Are the microorganisms in the intestines the same as those on the skin?
UE4_UE5结合罗技手柄(F710)使用记录
Txt file virus
USB(十六)2022-04-28
The 19th Zhejiang Provincial Collegiate Programming Contest 2022浙江省赛 F.EasyFix 主席树
USB (十八)2022-04-17
When copying something from the USB flash disk, an error volume error is reported. Please run CHKDSK
About idea cannot find or load the main class
Install a new version of idea. Double click it to open it
Unity dynamically merges mesh textures
Anta DTC | Anta transformation, building a growth flywheel that is not only FILA
ArcGIS:矢量要素相同字段属性融合的两种方法
网络安全-钓鱼
PMP project management exam pass Formula-1