Kodi Community Forum
date diff - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: date diff (/showthread.php?tid=20196)



- thor918 - 2006-05-28

anyone know how to calculate difference between to dates?
like how many years, days, hours,mins,secs ...

date format = may 21 2006






- Nuka1195 - 2006-05-28

http://pleac.sourceforge.net/pleac_python/datesandtimes.html


- thor918 - 2006-05-28

thanks alot!
Wink


- thor918 - 2006-05-28

that link was neat!
everything was so organized and explained good.


- Nuka1195 - 2006-05-28

ot: jmarshall added the unshuffle(). i included the file with another patch. all you have to do is zip the files you changed, then submit a patch. i don't think they want diff files.


- thor918 - 2006-05-28

yepp i read some of your posts.

i'm gonne check out one of your feature adds later
[ 1496246 ] xbmc.getinfolabel(int) & xbmc.getinfoimage(int) to python, thanks to nuka1195.

didn't jm update the last changes to that pach?

do you know if there are any built in conversions on months to numbers

like
jan = 1
if not i have to use a simple array.






- Nuka1195 - 2006-05-28

the getinfolabel() & getinfoimage() if you apply the angle patch i posted works by using the infotag name. it allows you to use:
Quote:gamertag = xbmc.getinfoimage("skin.string(gamertag)")

the current one in cvs takes an integer value. finding the right value is a pain, plus you could not use the above.

i don't know of any date functions off hand.


- thor918 - 2006-05-28

hope jm updates then.

by the way, i found what i was looking for, thanks to that like you gave me:
time.strptime(now_month,"%b")[1]
returns the number of month given in short