今天看网上一个说中文日期的问题.自己试了下.#-*-coding:gb2312-*-
importdatetime,time
#now=time.strftime(‘%Y年%m月%d日%H时%M分%S秒‘,time.localtime()).decode(‘utf-8‘)
now=time.strftime(‘%Y年%m月%d日%H时%M分%S秒‘,time.localtime())
printnow
now=time.strptime(no..
分类:
编程语言 时间:
2015-01-21 20:27:54
阅读次数:
196
Linux:[ghsea@localhost ~]date +%Y:%m:%d[ghsea@localhost ~]date +%Y-%m%d[ghsea@localhost ~]date +%y:%m:%dRuby: t=Date.today p t.strftime("%Y:%m:%d")有两点...
分类:
其他好文 时间:
2015-01-13 00:04:21
阅读次数:
121
因为sqlite为弱引用,使用字段前将他强制转为日期型,用datetime。或者最原始的strftime。SELECT distinct ID from testTable where datetime(availDate) between datetime('2015-01-12 04:00') ...
分类:
数据库 时间:
2015-01-09 12:27:24
阅读次数:
501
#!/usr/bin/envpython#KissPython#*/10****/usr/bin/python/root/checkslave.pyimportMySQLdbimporttimeimportparamikoips=[‘127.0.0.1‘]mailcontact=‘yiqiang.wei@kisspython.com‘mobilecontact=‘18701669895‘checklog=open(‘slave.log‘,‘a‘)checklog.write(str(time.strftime..
分类:
数据库 时间:
2015-01-02 07:36:11
阅读次数:
244
print(time.strftime("%Y%m%d%H%M%S", time.localtime()))得到:20141223100840
分类:
编程语言 时间:
2014-12-23 11:53:51
阅读次数:
118
08 [field:pubdate function=strftime('%d',@me)/]08 日 [field:pubdate function=strftime('%d日',@me)/]06-08 ...
分类:
其他好文 时间:
2014-12-22 16:09:46
阅读次数:
135
C/C++获取当前系统时间//方案— 优点:仅使用C标准库;缺点:只能精确到秒级#include #include int main( void ){ time_t t = time(0); char tmp[64]; strftime( tmp, sizeof(tmp), "%Y/%m/%d %X...
分类:
编程语言 时间:
2014-12-15 17:10:59
阅读次数:
447
1. 日期输出格式化所有日期、时间的api都在datetime模块内。1. datetime => stringnow = datetime.datetime.now()now.strftime('%Y-%m-%d %H:%M:%S')#输出2012-03-05 16:26:23.870105str...
分类:
编程语言 时间:
2014-12-12 11:33:21
阅读次数:
161
deftrace():ifnottrace.__dict__.has_key("started"):time=datetime.now().strftime(‘%Y-%m-%d%H:%M:%S‘)fh.write("\n[%s]%s"%(time,str))trace.started=True
分类:
其他好文 时间:
2014-12-03 14:26:47
阅读次数:
157
1、timetime.strftime('%Y-%m-%d',time.localtime(time.time()))##time.strftime()格式化时间#time.localtime()方法,作用是格式化时间戳为本地的时间#python中时间日期格式化符号:%y 两位数的年份表示(00-9...
分类:
编程语言 时间:
2014-11-17 10:31:17
阅读次数:
183