Date command does not follow Linux specifications (Mac OS X Lion)

后端 未结 3 1700
醉酒成梦
醉酒成梦 2020-11-28 07:53

I have been developing a script on my linux box for quite some time, and wanted to run it on my Mac as well.

I thought that the functions on the Mac were the same as

3条回答
  •  星月不相逢
    2020-11-28 08:21

    man date indicates that it doesn't go beyond one second. I would recommend trying another language (Python 2):

    $ python -c 'import time; print repr(time.time())'
    1332334298.898616
    

    For Python 3, use:

    $ python -c 'import time; print(repr(time.time()))'
    

提交回复
热议问题