Answers for "datetime timezone python"

26

datetime python

from datetime import datetime as d
date = d.now()
print(date.strftime("%Y-%m-%d %H:%M:%S"))
Posted by: Guest on December-09-2020
4

datetime python timezone

import datetime
import pytz
my_date = datetime.datetime.now(pytz.timezone('US/Pacific'))
Posted by: Guest on June-18-2020
0

datetime today

from datetime import datetime

# datetime object containing current date and time
now = datetime.now()
 
print("now =", now)

# dd/mm/YY H:M:S
dt_string = now.strftime("%d/%m/%Y %H:%M:%S")
print("date and time =", dt_string)
Posted by: Guest on September-01-2020
0

python set timezone of datetime.now

my_date = datetime.datetime.now(pytz.timezone('US/Pacific'))
Posted by: Guest on February-03-2021

Code answers related to "datetime timezone python"

Python Answers by Framework

Browse Popular Code Answers by Language