1π
β
It should be a timezone issue. As when we need to parse timestamp to datetime object, it will need the timezone setting, and by default it will leverage the system timezone. And the timezone on Azure services are all the same as America/Los_Angeles.
So you need to set your local timezone in your code, E.G:
import pytz
localtz = pytz.timezone('Asia/Hong_Kong')
starttijd = (datetime.datetime.fromtimestamp(appointment['start'],tz=localtz)).strftime('%H%M')
print starttijd
β¦
π€Gary Liu
Source:stackexchange.com