Sqlite 格式字符串返回格式化的日期

strftime('%s', 'now', '+8 hour') 格式化为当前时间的秒数

strftime('%M', 'now', '+8 hour') 格式化当前时间为分钟数

strftime('%H', 'now', '+8 hour') 格式化当前时间为小时

strftime('%Y-%m-%d %H:%M:%S', 'now', '+8 hour') 格式化当前时间为 %Y-%m-%d %H:%M:%S

strftime('%M', '2018-12-12 18:32:11') 把指定字符串格式化为分钟

时间相减

当前时间换算成秒数 减去指定时间(换算成秒数) 得到的是秒数

strftime('%s', 'now', '+8 hour') - strftime('%s', '2018-12-12 18:32:11')

.............................................................................得到分钟

strftime('%M', 'now', '+8 hour') - strftime('%M', '2018-12-12 18:32:11')

.............................................................................得到小时

strftime('%H', 'now', '+8 hour') - strftime('%H', '2018-12-12 18:32:11')

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值