# -*- coding: utf-8 -*-
# date=2020/3/27
import time
import uuid def getTimestamp_1770():
now_1770 = round(time.time() - 1770) * 1000
return now_1770 def getTimestamp(num):
# 1800为30分钟,1740为29分钟
now_1770 = round(time.time() - num) * 1000
return now_1770 def getTimestamp_1700():
now_1700 = round(time.time() - 1700) * 1000
return now_1700 def getTimestamp_1690():
now_1710 = round(time.time() - 1690) * 1000
return now_1710 def getTimestamp_1680():
now_1720 = round(time.time() - 1680) * 1000
return now_1720 def timeToTimestamp(timeStr):
# 先转换为时间数组
timeArray = time.strptime(timeStr, "%Y-%m-%d %H:%M:%S")
# 转换为时间戳
timeStamp = int(time.mktime(timeArray)) * 1000
# print(timeStamp)
return timeStamp def timestampToTime(timeStamp):
timeArray = time.localtime(timeStamp / 1000)
timeStamp = time.strftime("%Y-%m-%d %H:%M:%S", timeArray)
# print(timeStamp)
return timeStamp if __name__ == '__main__':
# a = timeToTimestamp('2020-03-27 13:46:20')
#
# a = getTimestamp_1700()
# p = timestampToTime(a)
# print(p)
print(uuid.uuid1())
pass

最新文章

  1. [转]python 常用类库!
  2. [mobile开发碎碎念]手机页面上显示PDF文件
  3. the usage of map.put
  4. phonegap+html5开发app的一些总结
  5. ext 金额大写
  6. Caption,Text,WindowText的区别——TControl也有FText,是为了模拟一个窗口
  7. Tcpdump命令行 与 GUI Wireshark
  8. Web.Config文件中添加数据库配置文件
  9. Introduction to Guid ( globally unique identifier )
  10. 在 Arch 下编译 OpenWRT cmcurl 问题与解决方案
  11. js单元测试
  12. Qt5.7.0移植到4412
  13. 项目构建之maven篇:5.仓库及nexus创建私服-2
  14. Java的GUI设计中如何跨界面传值
  15. C#+AE 判断点是否在面内的方法
  16. using 释放内存的写法
  17. sparkuser is not in the sudoers file. This incident will be reported.
  18. WebService客户端调用的几种方式
  19. MySQL-ALTER TABLE命令学习[20180503]
  20. oracle11g之Oracle体系结构(理论基础知识)

热门文章

  1. POJ 1170 Shopping Offers非状态压缩做法
  2. POJ 2230 Watchcow 欧拉回路的DFS解法(模板题)
  3. P4168 蒲公英
  4. libevent(三)event_base
  5. 记一次jackson序列化Boolean的坑
  6. iOS的内存管理和引用计数规则、Block的用法以及三种形式(stack、malloc、global)
  7. MongoDB最佳安全实践
  8. 一文教你快速学会在matlab的simulink中调用C语言进行仿真
  9. Python自动生成100以内加减乘除混合运算题
  10. gather函数