'start of day' modifier and Julian day timestring

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

'start of day' modifier and Julian day timestring

Mark Brand
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
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: 'start of day' modifier and Julian day timestring

Richard Hipp-3
On 3/2/17, Mark Brand <[hidden email]> wrote:
> I am wondering why the 'start of day' and 'start of year' modifiers
> don't seem to work on Julian day timestrings.

https://www.sqlite.org/src/timeline?y=ci&c=081dbcfb

Tnx for the bug report.

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users