Getting dates in ISO text format

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Getting dates in ISO text format

Re: Getting dates in ISO text format

by phramusca » Wed Apr 04, 2012 6:42 am

MM wrote:The best is to look at other scripts, doing so i found this:
select datetime(LastTimePlayed+2415018.5) from songs
Thanks a lot ! That's exactly what I needed :)

Re: Getting dates in ISO text format

by MM » Wed Apr 04, 2012 4:48 am

The best is to look at other scripts, doing so i found this:
select datetime(LastTimePlayed+2415018.5) from songs

Re: Getting dates in ISO text format

by phramusca » Wed Apr 04, 2012 4:35 am

Hello,

I still need help !! :)

Getting dates in ISO text format

by phramusca » Mon Apr 02, 2012 7:32 am

Hi,

I am trying to get statistics information from MM.db, but cannot manage to transform your Julian dates into a "YYYY-MM-DD HH:MM:SS" format.
I have tried (at least) the following, but none works. I get weird datetimes (year being -4600 or -1413 where it should be 2012).

SELECT SongPath AS fullPath,
datetime(LastTimePlayed),
datetime(LastTimePlayed, 'localtime'),
datetime((julianday(LastTimePlayed) - 2440587.5)*86400.0, 'unixepoch', 'localtime'),
datetime((LastTimePlayed - 2440587.5)*86400.0, 'unixepoch')
FROM Songs ORDER BY LastTimePlayed DESC
LIMIT 0,10

Could you let me know what SQL statement I should use to get the dates (LastTimePlayed and DateAdded) in "YYYY-MM-DD HH:MM:SS" format ?
Thanks

Top