SQLite中负日期 [英] Negative dates in SQLite

查看:197
本文介绍了SQLite中负日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

新编译的SQLite显示关于日期/时间函数一个奇怪的行为。你有任何想法是怎么回事,如何解决?

Newly compiled SQLite displays a strange behavior concerning the date/time functions. Do you have any idea what is going on and how to fix it?

    $ date
    Mon Mar  8 14:52:11 CET 2010

    $ ./sqlite3 TEST0
    SQLite version 3.6.22
    Enter ".help" for instructions
    Enter SQL statements terminated with a ";"
    sqlite> SELECT date('now');
    -4713-11-24

    sqlite> SELECT strftime('%s','now');
    -210866760000

    sqlite> select datetime( -210866760000 , 'unixepoch');
    1970-01-01 00:00:00

该版本是ARM-Linux的SQLite的3_6_22。我不知道......也许有些crosscompilation问题?

The version is SQLite 3_6_22 for ARM-Linux. I'm not sure...maybe some crosscompilation problems?

推荐答案

...确保编制调整为将ARM( -mtune = ARM920T 的具体型号),而不仅仅是一般的阿梅尔,ARM9和喜欢。否则,程序运行总体不错,但没有得到访问各种功能,如时钟...

...make sure the compilation is adjusted for your specific model of ARM ( -mtune=arm920t ) instead of just generic armel, arm9 and the likes. Otherwise the program works okay in general, but doesn't get access to various features like the clock...

这篇关于SQLite中负日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆