Python
来源:互联网 发布:珠宝设计绘图软件 编辑:程序博客网 时间:2024/06/04 17:57
1. 函数原型
strptime函数可以从一个具有时间格式的字符串中获取时间信息,其函数原型为:
strptime(string, [format)
2. 应用
import time""" 返回值struct_day为一个struct格式的时间, 包含9个元素: tm_year: 年 tm_mon: 月 tm_mday: 日 tm_hour: 时 tm_min: 分 tm_sec: 秒 tm_wday: 星期几 tm_yday: 一年中的第几天 tm_isdst: 是否夏令时 struct_day: 2017 8 26 0 0 0 5 238 -1"""struct_day = time.strptime("2017-08-26", "%Y-%m-%d")
阅读全文
0 0
- Python
- Python
- Python
- python
- Python
- PYTHON
- Python
- Python
- Python
- Python
- Python
- Python
- Python
- Python
- Python
- Python
- python
- Python
- 编写程序从键盘得到三个整数,找出其中的最大数
- php上传文件
- 最大子段求和问题
- bzoj3796 Mushroom追妹纸(SA+二分答案+kmp)
- Jps命令—使用详解
- Python
- TCP/IP、Http、Socket的区别以及面试中关于网络协议常问的考点
- 大数据学习5:hdfs和yarn 的学习记录
- JavaScript中的ERROR对象技术详解
- Unity 鼠标跟随点击位置
- Qt中tcp传输文件遇到的问题
- Linked List Random Node问题及解法
- Maven学习记录3——创建、编译、打包、运行项目
- 机器学习笔记4:TensorFlow基础入门介绍