2020-05-28, 13:54
Hi .. I'm making a simple Kodi add-on for myself. I'm a complete layman and I got trapped where I don't know how to help or help the internet.
I am importing the date and time from the Guide (EPG) meeting in the form of eg: 1.1.2000 10:00 in the variable "olddate"
since I need to convert the date to a certain form which I managed after several attempts but I still need the resulting time in the variable "newdate" to be two hours less (UTC)
I have now:
I need:
source:
very thanks for me help
I am importing the date and time from the Guide (EPG) meeting in the form of eg: 1.1.2000 10:00 in the variable "olddate"
since I need to convert the date to a certain form which I managed after several attempts but I still need the resulting time in the variable "newdate" to be two hours less (UTC)
I have now:
Code:
ADRESA/20000101_name_20000101_100000/ADRESA
I need:
Code:
ADRESA/20000101_name_20000101_080000/ADRESA
source:
Code:
import xbmc
import xbmcgui
from datetime import datetime, timezone, timedelta
title = xbmc.getInfoLabel('Listitem.Title')
olddate = xbmc.getInfoLabel('Listitem.Date')
start = xbmc.getInfoLabel('Listitem.StartTime')
name = xbmc.getInfoLabel('ListItem.ChannelName')
url = 'ADRESA'
get = '_'
newdate = datetime.strptime(olddate, "%d.%m.%Y %H:%M")
file = 'ADRESA' + newdate.strftime("%Y%m%d") + get + name.replace(" ", "_") + get + newdate.strftime("%Y%m%d_%H%M%S") + url
xbmc.Player().play(file)
very thanks for me help