
Nyn
I think you should use date('now', 'localtime') instead of date('now'). Also state for julianday.Bex wrote:I currently looking into the PlayHistory script now due to some newly discovered behaviour of how SQLite defines 'now'. It's considered as now in GMT so the script doesn't work properly unless you live in GB. It's most notable in the Played Today/Played Yesterday -Nodes which actually you reported some time ago. It's fixed now so I'll see if I easily can change the Top 100 nodes as well.
Maybe you came to the same conclusion, but your solutions are wrong. You should specify 'local' if you want to take in account the local time zone.Bex wrote:Me and tekno came to that conclusion yesterday
I thought for long time that it should be like that, but after more in dept testing I concluded that it should be 2415019.0 (e.g. julianday('1899-12-30 12:00')), but it is not necessary always. For example, if expression contain 'now', it should be with 2415019.0.Regarding Julianday
I just calculated backwards and got the figure 2415018.5.
Hmm..ZvezdanD wrote:I thought for long time that it should be like that, but after more in dept testing I concluded that it should be 2415019.0 (e.g. julianday('1899-12-30 12:00')), but it is not necessary always. For example, if expression contain 'now', it should be with 2415019.0.Regarding Julianday
I just calculated backwards and got the figure 2415018.5.
This is obvious if you take a look on SQLite definition for julianday - you get full day in the noon, not in the midnight.
Bex wrote:Yes that was our solution!
It depends from situations and how you consider a full day. For example, let say that I add a track in 10 AM today. When will I get one day since added: tomorrow in 00:00 or in 10 AM? Or maybe one day after tomorrow in 00:00? Same question could be asked for your Last week and Last month (but not for Previous week and Previous month). I consider that a full day is from 00:00 until next day in 00:00, so for me one day since added is one day after tomorrow from 00:00. Your script calculates full day from one point in time to this time + 24:00, e.g. in previous example it is tomorrow from 10 AM. But never mind, forget about this - it is questionable if my approach is anything better. Maybe I will return my calculations to 2415018.5.If i use 2415019.0 then I get a mismatch with 12 hours
If i use 2415018.5 then I get it right.
Maybe you didn't understand me - you mistyped intiger instead of integer. Just replace all such appearances.Bex wrote:Regarding the cast thing. It's due to I want the date without time. I don't see how I can change it?