没有足够的例子,我一直在绕圈子,以得到由“日期”打印出来的 iso8601 的“秒”版本。请查看busybox 1.22.1 提供的帮助。我似乎无法理解所需的语法。根据我的经验,例子胜于雄辩,我还没有在网上找到任何有用的东西。
这是我尝试过的:
➤ date -I=seconds
➤ date -I SPEC='seconds'
➤ date -I seconds
➤ date -I='seconds'
➤ date -I 'seconds'
➤ date -I['seconds']
➤ date -I TIMESPEC='seconds'
➤ date -I TIMESPEC=seconds
注意我尝试使用 Ubuntu 版本的日期,并且能够弄清楚如何获得 iso8601=seconds 日期格式,但在busybox中却没有......
以下是 Busybox 1.22.1 的 date 帮助显示的内容:
BusyBox v1.22.1 (2014-09-26 07:33:17 CEST) multi-call binary.
Usage: date [OPTIONS] [+FMT] [TIME]
Display time (using +FMT), or set time
[-s,--set] TIME Set time to TIME
-u,--utc Work in UTC (don't convert to local time)
-R,--rfc-2822 Output RFC-2822 compliant date string
-I[SPEC] Output ISO-8601 compliant date string
SPEC='date' (default) for date only,
'hours', 'minutes', or 'seconds' for date and
time to the indicated precision
-r,--reference FILE Display last modification time of FILE
-d,--date TIME Display TIME, not 'now'
-D FMT Use FMT for -d TIME conversion