码迷,mamicode.com
首页 >  
搜索关键字:strftime    ( 605个结果
Python 日期格式相关
今天看网上一个说中文日期的问题.自己试了下.#-*-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
date格式化
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 日期型 字符串转为日期型
因为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
Mysql主从检测脚本
#!/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
python日期格式化
print(time.strftime("%Y%m%d%H%M%S", time.localtime()))得到:20141223100840
分类:编程语言   时间:2014-12-23 11:53:51    阅读次数:118
dede 日期的所有格式
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/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
Python日期的加减等操作
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
python笔记
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
605条   上一页 1 ... 55 56 57 58 59 ... 61 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!