码迷,mamicode.com
首页 >  
搜索关键字:strftime    ( 605个结果
Python日期时间函数处理
所有日期、时间的 api 都在datetime模块内。 1 日期的格式化输出 datetime => string import datetime now = datetime.datetime.now() now.strftime('%Y-%m-%d %H:%M:%S') 输出 '2015-04- ...
分类:编程语言   时间:2016-09-29 07:44:13    阅读次数:213
sqlite
Round(X,Y) 将X进行小数位四舍五入取值 若省掉Y,将四舍五入为整数 Select Round( K1,2) as K1 From tableName 对时间进行规范化输出 strftime('%Y-%m-%d %H:%M:%S',TimeCreate) as TimeCreate 插入或更 ...
分类:数据库   时间:2016-09-26 14:31:04    阅读次数:146
python获取当前时间的用法
1.先导入库:from datetime import datetime 2.获取当前日期和时间:now_time = datetime.now() 3.格式化成我们想要的日期:strftime() 比如:“2016-09-21”:datetime.now().strftime('%Y-%m-%d' ...
分类:编程语言   时间:2016-09-21 18:42:30    阅读次数:150
Django的model中日期字段设置默认值的问题
之前写过这样一个model: 写完之后发现每天runserver的时候都会提示要makemigrations,经过排查发现问题出在设置的默认值上。 把字段check_day的默认值设置成default=datetime.strftime(date.today(), "%Y-%m-%d") 会导致它在 ...
分类:其他好文   时间:2016-09-19 17:29:56    阅读次数:291
php取得当前时间函数
方法一date函数 //2016-09-1 10:00:08 方法二 time函数 $time = time(); echo date("y-m-d",$time) //2016-09-1 方法三 $_server['server_time'] 方法四 strftime echo strftime ...
分类:Web程序   时间:2016-09-01 10:52:06    阅读次数:144
python中时间相关问题,仅作为笔记
1.获取当前时间的两种方法: import datetime,timenow = time.strftime("%Y-%m-%d %H:%M:%S")print nownow = datetime.datetime.now()print now 2.获取上个月最后一天的日期(本月的第一天减去1天) ...
分类:编程语言   时间:2016-08-07 23:16:17    阅读次数:217
redmine computed custom field formula tips
项目中要用到Computed custom field插件,公式不知道怎么写,查了些资料,记录在这里。 1、http://apidock.com/ruby/Time/strftime 查看ruby的字符串格式,用于改写Date/time format只显示日期,不显示时间。 2、https://gi ...
分类:其他好文   时间:2016-08-05 23:09:22    阅读次数:466
Python运维-获取当前操作系统的各种信息
#通过Python的psutil模块,获取当前系统的各种信息(比如内存,cpu,磁盘,登录用户等),并将信息进行备份 #coding=utf-8 #获取系统基本信息 importsys importpsutil importtime importos #获取当前时间 time_str=time.strftime("%Y-%m-%d",time.localtime()) file_name="./..
分类:编程语言   时间:2016-07-22 19:39:12    阅读次数:330
织梦dedecms文章发布日期时间调用标签大全
dedecms首页时间标签: 1、12-27 样式 [field:pubdate function='strftime("%m-%d",@me)'/] 2、May 15, 2012 样式 [field:pubdate function='strftime("%b %d, %Y",@me)'/] de ...
分类:其他好文   时间:2016-07-21 12:23:36    阅读次数:218
python备份、删除过期压缩文件
#!/usr/bin/python#-*-coding:utf-8-*-importos,sys,datetimeimportshutilimporttimedefzipfile(s_dir,path="."):target=path+os.sep+s_dir.split(‘/‘)[-1]+time.strftime(‘%Y%m%d%H%M%S‘)+‘.zip‘zip_command="zip-qr%s%s-x‘*.gz‘"%(target,s_dir)ifos.system(zip_command)==0:..
分类:编程语言   时间:2016-07-06 18:35:17    阅读次数:308
605条   上一页 1 ... 47 48 49 50 51 ... 61 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!