码迷,mamicode.com
首页 >  
搜索关键字:strftime    ( 605个结果
php获取指定日期所在星期的开始时间与结束时间
function getWeekRange($date){ $ret=array(); $timestamp=strtotime($date); $w=strftime('%u',$timestamp); $ret['sdate']=date('Y-m-d 00:00:00',$timestamp-...
分类:Web程序   时间:2015-07-14 20:17:19    阅读次数:129
python时间处理
1.获取当前时间的两种方法:import datetime,timenow = time.strftime("%Y-%m-%d %H:%M:%S")print nownow = datetime.datetime.now()print now2.获取上个月最后一天的日期(本月的第一天减去1天)las...
分类:编程语言   时间:2015-06-23 15:25:08    阅读次数:218
python的Nginx切割脚本
#!/usr/bin/envpython #date:2015-06 #Author:ley #Curthenginx‘saccess_log #-*-coding:UTF-8-*- importos,time path=[‘/var/log/nginx/‘,‘/var/run/nginx/nginx.pid‘,‘access.log‘] time=time.strftime(‘%Y-%m-%d‘) command="cd%s&&/bin/cp%s%s&&/bin/kil..
分类:编程语言   时间:2015-06-16 01:26:05    阅读次数:141
时间格式化函数strftime
?? #include #include #include int main() {   char timebuf[100]={0};   time_t timep;    struct tm *p_tm;       timep = time(NULL);    p_tm = localtime(&timep); /*获取本地时区时间*/      st...
分类:其他好文   时间:2015-06-12 19:24:30    阅读次数:111
时间戳前
1.最近时间验算 def?get(self): ????ttmms=[] ????ttds=[] ????tths=[] ????ttms=[] ????ttyy=int(time.strftime(‘%Y‘))??#获取当年 ????ttmm=int(time.strftime(‘%m‘))??#获取当月...
分类:其他好文   时间:2015-06-09 17:52:44    阅读次数:102
python 日期转星期
import timeimport datetimetoday = int(time.strftime('%w'))print todayanyday = datetime.datetime(2012, 04, 22).strftime('%w')print anyday
分类:编程语言   时间:2015-06-03 11:32:37    阅读次数:161
python下输出指定年月日的方法之一
参考自:http://www.cnblogs.com/rollenholt/archive/2012/04/11/2441699.html格式字符串datetime、date、time都提供了strftime()方法,该方法接收一个格式字符串,输出日期时间的字符串表示。下表是从python手册中拉过...
分类:编程语言   时间:2015-05-28 21:24:04    阅读次数:221
Python写的备份目录文件的脚本
#!/usr/bin/python#-*-coding:utf-8-*-#filenameback.py#authorsuperchenimportosimporttimesource=‘/home/shiyanlou/Documents/‘target_dir=‘/home/shiyanlou/Desktop‘target=target_dir+time.strftime(‘%Y-%m-%d-%H-%M-%S‘)+‘.zip‘zip_command="zip-qr%s%s"%(target,‘‘.join(..
分类:编程语言   时间:2015-05-27 16:00:50    阅读次数:174
Python 中的 time 模块
从time模块的帮助文档中,发现相关的函数主要有如下:time()--returncurrenttimeinsecondssincetheEpochasafloat clock()--returnCPUtimesinceprocessstartasafloat sleep()--delayforanumberofsecondsgivenasafloat gmtime()--convertsecondssinceEpochtoUTCtuple localtime()-..
分类:编程语言   时间:2015-05-18 01:15:41    阅读次数:237
python中date、datetime、string的相互转换
importdatetimeimporttimestring转datetimestr=‘2012-11-19‘date_time=datetime.datetime.strptime(str,‘%Y-%m-%d‘)date_timedatetime.datetime(2012,11,19,0,0)datetime转stringdate_time.strftime(‘%Y-%m-%d‘)‘2012-11-19‘datetime转时间戳time_time=time.mktime(date_time.t..
分类:编程语言   时间:2015-04-26 01:48:53    阅读次数:190
605条   上一页 1 ... 52 53 54 55 56 ... 61 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!