Skip to content
TheChatArchiveThe Chat Archive
gpt-3.5-turbo-0301· OpenAIAi2 WildChat-4.8M (AI2)

python2获取时间戳

  1. User

    python2获取时间戳

  2. Assistant

    在Python2中,可以使用time模块的time()方法来获取当前时间戳。

    示例代码:

    import time
    
    timestamp = int(time.time())
    print(timestamp)
    

    输出结果会是10位数的时间戳,例如:1633457220。

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.