sqlite日期操作方法

SQLite的日期操作:
SQLite支持五中日期时间函数, 如下:

strftime时间字串格式化

%d day of month: 00
%f fractional seconds: SS.SSS
%H hour: 00-24
%j day of year: 001-366
%J Julian day number
%m month: 01-12
%M minute: 00-59
%s seconds since 1970-01-01
%S seconds: 00-59
%w day of week 0-6 with Sunday==0
%W week of year: 00-53
%Y year: 0000-9999

%%%

以下结果是等价的
date(…)

再看看修饰符:

例子:
Compute the current date.

SELECT date(‘now’);

Compute the last day of the current month.

Original: https://blog.csdn.net/weixin_40029679/article/details/124501794
Author: kingwebo’sZone
Title: sqlite日期操作方法

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/815259/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球