There are various ways of adding a day for example:
import datetime
print(datetime.datetime.now() + datetime.timedelta(days=1))
The problem with this is that the answer is: 2016-12-06 16:52:44.679431 I only need 2016-12-06. I can easily get that by performing a string manipulation like splitting. I as wondering if there was a way to do it directly.
secondly:
From what I have read from the documentation the below two ways should give me the time in my timezone neither do though.
import time
print(time.localtime())
result: time.struct_time(tm_year=2016, tm_mon=12, tm_mday=5, tm_hour=17, tm_min=50, tm_sec=56, tm_wday=0, tm_yday=340, tm_isdst=0)
&
import datetime
print(datetime.datetime.now())
return 2016-12-05 17:52:09.045170
neither do, they both give me GMT:
How do I get my local timezone?
Summary: Is there a direct way to a day and get the correct form? an How do I get my local timezone?