我对 Perl 语言很陌生。如何转换UUID
迄今为止的格式2011-04-22
?
例如,我有这样的UUID
118ffe80-466b-11e1-b5a5-5732cf729524
.
如何将其转换为日期格式?
该模块UUID::小 https://metacpan.org/module/UUID::Tiny有一个名为 time_of_UUID() 的方法可能会有所帮助:
time_of_UUID()
This function accepts UUIDs and UUID strings.
Returns the time as a floating point value, so use int()
to get a time() compatible value.
Returns undef if the UUID is not version 1.
my $uuid_time = time_of_UUID($uuid);
的时间戳部分RFC4122 https://www.rfc-editor.org/rfc/rfc4122#section-4.1.4还可以补充维基百科 http://en.wikipedia.org/wiki/Universally_unique_identifier关于 UUID 的文章。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)