python里面如何获的日期值
来源:互联网 发布:java软件安装教程 编辑:程序博客网 时间:2024/06/06 09:10
这个问题很简单,通过一个import time,然后time.localtime()这个函数会提供很多有用的信息,看代码就知道了
import timethisyear = time.localtime()print thisyearthisyear = time.localtime()[0]print thisyear
仔细分析,第一个thistime,thistime表示出了一个结构体信息,里面给了各种时间信息,包括年,月日等
下面的thisyear表示出了如何使用这个函数[0] 代表是第一个值
附上截图:
0 0
- python里面如何获的日期值
- jsp里面的日期格式
- jsp里面的日期格式
- Python里面如何生成随机数?
- Python里面如何实现tuple和list的转换?
- 2.6 Python里面如何实现tuple和list的转换?
- 用Python如何处理excel里面的数据
- python 爬虫如何获取js里面的内容
- python里面的list
- python里面的函数
- Python里面的字典
- Python里面的正则
- Python里面的字典
- python题目-----Python里面如何生成随机数
- Python如何获取当前的日期和时间
- Python:如何获取当前的日期和时间
- Python:如何获取当前的日期和时间
- python:如何获取当前的日期和时间
- jstl架包
- c++ primer第五版(中文)习题答案 第二章第六节-自定义数据结构
- Android SDK安装更新:Failed to fetch URL https://dl-ssl.google.com/android/repository/addons_list-2.xml
- spring 笔记
- iOS 开发懒加载
- python里面如何获的日期值
- FFTW3安装与库环境变量设置(路径设置)
- 《leetCode》:3Sum Closest
- HTML学习12:其他常见标签之头标签
- hdu5510 Bazinga
- undefined reference to __android_log_print
- StringBuffer
- leetcode之Binary Search Tree Iterator
- UML第十二集(14)之活动图