Getting dates in ISO text format

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey for Windows 4.

Moderators: Gurus, Addon Administrators

phramusca
Posts: 3
Joined: Mon Apr 02, 2012 7:14 am

Getting dates in ISO text format

Post by phramusca »

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
phramusca
Posts: 3
Joined: Mon Apr 02, 2012 7:14 am

Re: Getting dates in ISO text format

Post by phramusca »

Hello,

I still need help !! :)
MM

Re: Getting dates in ISO text format

Post by MM »

The best is to look at other scripts, doing so i found this:
select datetime(LastTimePlayed+2415018.5) from songs
phramusca
Posts: 3
Joined: Mon Apr 02, 2012 7:14 am

Re: Getting dates in ISO text format

Post by phramusca »

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 :)
Post Reply