I am using dateutil.parser to generate a random date, it seem to be in my local timezone, how do I generate it in UTC/GMT?
from dateutil import parser new_date = str(random.randint(1,27))+"/"+str(random.randint(1,12))+"/"+str(random.randint(2001,2020)) #d/m/y targetdate = parser.parse(new_date, dayfirst=True)
https://stackoverflow.com/questions/67363174/in-python-how-to-generate-date-in-utc-gmt May 03, 2021 at 11:29AM
没有评论:
发表评论