Hi,

I am wondering why the 'start of day' and 'start of year' modifiers don't seem to work on Julian day timestrings. What is the explanation for the NULLs in examples 2 and 3 below?

SELECT  example,
        timestring,
        strftime('%J',  timestring),
        strftime('%Y-%m-%d %H:%M',  timestring),
        strftime('%Y-%m-%d %H:%M',  timestring, '+21 minute'),
        strftime('%Y-%m-%d %H:%M',  timestring, 'localtime'),
        strftime('%Y-%m-%d %H:%M',  timestring, 'start of day')
FROM (
                  SELECT 1 example, 'now' timestring
            UNION SELECT 2, strftime('%J', 'now')
            UNION SELECT 3, 2457754
            UNION SELECT 4, strftime('%Y-%m-%d %H:%M', 2457754)
            UNION SELECT 5, strftime('%Y-%m-%d %H:%M', 'now')
) X
ORDER BY example


"1" "now" "2457815.431712523" "2017-03-02 22:21" "2017-03-02 22:42" "2017-03-02 23:21" "2017-03-02 00:00" "2" "2457815.431712523" "2457815.431712523" "2017-03-02 22:21" "2017-03-02 22:42" "2017-03-02 23:21" "NULL" "3" "2457754" "2457754" "2016-12-31 12:00" "2016-12-31 12:21" "2016-12-31 13:00" "NULL" "4" "2016-12-31 12:00" "2457754" "2016-12-31 12:00" "2016-12-31 12:21" "2016-12-31 13:00" "2016-12-31 00:00" "5" "2017-03-02 22:21" "2457815.43125" "2017-03-02 22:21" "2017-03-02 22:42" "2017-03-02 23:21" "2017-03-02 00:00"


_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to