1. 首页
  2. 课程学习
  3. 软件测试
  4. python和node.js生成当前时间戳的示例

python和node.js生成当前时间戳的示例

上传者: 2020-12-17 07:35:24上传 PDF文件 49.73KB 热度 14次
Python # coding=utf-8 import time import sys def func(): # 格式化输出时间 s1 = int(time.strftime("%Y%m%d%H%M%S", time.localtime())) # 时间戳,由于默认是秒需要转换为毫秒输出 s2 = int(round(time.time() * 1000)) return s1, s2 def once(): '''如果没有指明命令行参数则运行一次''' s1, s2 = func() print(s1) print(s2) def main():
下载地址
用户评论