I am using the below code to convert INPUT(IST-Asia/Kolkata) time to UTC, it worked fine locally but didn't work on AWS batch. I am using pytz module.
def get_utc_time():
fmt = "%Y-%m-%d %H:%M:%S"
now_local = "2020-02-13"
local_date = datetime.strptime(now_local, '%Y-%m-%d')
change_time = local_date.astimezone(timezone('UTC'))
utc_date_time = change_time.strftime(fmt)
print(utc_date_time)
get_utc_time()
OUTPUT locally on IDE = 2020-02-12 18:30:00
OUTPUT on AWS Batch = 2020-02-13 00:00:00
Expected OUTPUT on aws batch= 2020-02-12 18:30:00