开发者

linux time format command

开发者 https://www.devze.com 2023-03-08 04:44 出处:网络
Here am stacked with asmall problem. I need to know the exact command to get the time 开发者_开发问答in following format:-86400000.

Here am stacked with a small problem. I need to know the exact command to get the time 开发者_开发问答in following format:-86400000. But problem is from the system am getting the format like:-24:00:00.

please give me the exact command


If I understand your desired output correctly (seconds since the epoch), you can use:

date +%s

See man date for the explanation of the different formats available if this isn't right.


(Technically, the answer to your question is to run date +-86400000 which will format the time exactly as you asked for. You really should improve the question...)


As addition to Andrzejs answer:

for a shorter overview:

date --help

for a more verbose one:

info coreutils date invocation
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号