• sqlite 时间戳转时间


    select datetime((timestamp/1000), 'unixepoch','localtime')  from messages where data != '' order by timestamp desc 

    官方eg:

    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.
    
    SELECT datetime(1092941466, 'unixepoch', 'localtime');
    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:
    
    SELECT strftime('%s','now') - strftime('%s','2004-01-01 02:34:56');
    Compute the date of the first Tuesday in October for the current year.
    
    SELECT date('now','start of year','+9 months','weekday 2');
    Compute the time since the unix epoch in seconds (like strftime('%s','now') except includes fractional part):
    
    SELECT (julianday('now') - 2440587.5)*86400.0;
  • 相关阅读:
    POJ2253 Frogger
    搜索专题(复习)
    机器学习资料整理
    51nod 1873 初中的算术
    Canny检测理解和Matlab实现
    Floyd+限制路径步数(快速幂优化)
    bitset优化背包问题
    Educational Codeforces Round 44 (Rated for Div. 2)
    BZOJ 3224 SBT 普通平衡树
    本科课程大数据基础
  • 原文地址:https://www.cnblogs.com/cbugs/p/10153953.html
Copyright © 2020-2023  润新知