加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

SQLite日期函数示例

发布时间:2020-12-12 19:44:07 所属栏目:百科 来源:网络整理
导读:转自:http://www.sqlite.org/lang_datefunc.html Examples Compute the current date. SELECT date('now'); Compute the last day of the current month. SELECT date('now','start of month','+1 month','-1 day'); Compute the date and time given a uni

转自:http://www.sqlite.org/lang_datefunc.html

Examples

Compute the current date.

SELECT date('now');


Compute the last day of the current month.

SELECT date('now','start of month','+1 month','-1 day');


Compute the date and time given a unix timestamp 1092941466.

SELECT datetime(1092941466,'unixepoch');

Compute the date and time given a unix timestamp 1092941466,and compensate for your local timezone.

Compute the current unix timestamp.

SELECT strftime('%s','now');

Compute the number of days since the signing of the US Declaration of Independence.

SELECT julianday('now') - julianday('1776-07-04');

Compute the number of seconds since a particular moment in 2004:

Compute the date of the first Tuesday in October for the current year.

Compute the time since the unix epoch in seconds (like strftime('%s','now') except includes fractional part):

SELECT (julianday('now') - 2440587.5)*86400.0;

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读