python和node.js生成当前时间戳的示例
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():
下载地址
用户评论