我想将当前日期和时间转换为十六进制时间戳,例如:
2010 年 2 月 2 日星期二 10:27:46 GMT 转换为 0x6d054a874449e
我想通过 bash 脚本执行此操作,知道我该怎么做吗?
谢谢 J
最佳答案
printf '0x%x' $(date +%s)
关于bash - 从 bash 脚本获取十六进制时间戳,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3712686/
我想将当前日期和时间转换为十六进制时间戳,例如:
2010 年 2 月 2 日星期二 10:27:46 GMT 转换为 0x6d054a874449e
我想通过 bash 脚本执行此操作,知道我该怎么做吗?
谢谢 J
最佳答案
printf '0x%x' $(date +%s)
关于bash - 从 bash 脚本获取十六进制时间戳,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3712686/