如何转换UUID
为日期格式2011-04-22
?
例如,我有这样的UUID
118ffe80-466b-11e1-b5a5-5732cf729524.
Run Code Online (Sandbox Code Playgroud)
如何将其转换为日期格式?
我试过了
String uuid="118ffe80-466b-11e1-b5a5-5732cf729524";
UUID uid = UUID.fromString(uuid);
long ls=convertTime(uid.timeStamp()); // it returns long value
public String convertTime(long time){
System.out.println("====="+time);
Date date = new Date(time);
Format format = new SimpleDateFormat("yyyy/MM/dd");
return format.format(date).toString();
}
Run Code Online (Sandbox Code Playgroud)
输出我得到:4294744/11/02
同样的情况对perl工作正常
$uuid='ef802820-46b3-11e2-bf3a-47ef6b3e28e2';
$uuid =~ s/-//g;
my $timelow = hex substr( $uuid, 2 * 0, 2 * 4 );
my $timemid = hex substr( $uuid, 2 * 4, 2 * 2 );
my $version = hex substr( $uuid, 2 * …
Run Code Online (Sandbox Code Playgroud) 在Windows中使用哪个命令来查找tomcat是否正在运行?
我们怎么知道JVM突然崩溃了?
谷歌搜索后我发布了它,我无法找到预期的结果.