如何获取以下格式的bash日期
2023-04-03T23:59:59.000Z
我试图连接字符串,但它看起来不干净的方法
odopli941#
你可以使用下面的date命令:
date
date -u +"%FT%T.%3NZ"
说明:
-u flag tells date to use the UTC timezone %F specifier is a shorthand for %Y-%m-%d %T specifier is a shorthand for %H:%M:%S %3N specifier represents the milliseconds in the current time Z at the end indicates that the time is in UTC.
1条答案
按热度按时间odopli941#
你可以使用下面的
date
命令:说明: