python判断给定的字符串是否是一个有效的日期,python给定,def is_valid
python判断给定的字符串是否是一个有效的日期,python给定,def is_valid
def is_valid_date(str): '''判断是否是一个有效的日期字符串''' try: time.strptime(str, "%Y-%m-%d") return True except: return False
使用方法:
print(is_valid_date('2013-04-18'))返回True
相关内容
- python通过MD5验证网站下载文件的有效性,pythonmd5,# -*-
- python通过while循环计算1到n的和,pythonwhile,def sum(n):
- 在python的类和函数中使用静态变量,python静态,方法一
- python向sqlite插入数据代码演示,pythonsqlite,import sqlit
- python实现绑定到特定地址和端口的socket server,pythonso
- Inverse power method for solving the eigenvalue problem in Python,i
- python使用nntp读取新闻组内容,pythonnntp,from nntplib
- python判断给定的数是否是回文数,,#! /usr/bin/
- python判断远程端口是否打开,python判断端口,import sock
- Powell’s method of minimizing user-supplied function in Python,,'
评论关闭