Answers for "time.strptime"

4

strptime python

import datetime
d =datetime.datetime.strptime("01/27/2012","%m/%d/%Y").strftime('%m/%d/%Y')
print d
01/27/2012
Posted by: Guest on October-08-2020
0

python - oordinated universal time

from datetime import datetime, timezone
print(datetime.now())              # timezone
print(datetime.now(timezone.utc))  # coordinated universal time
Posted by: Guest on August-13-2020
0

strptime

import datetime

date = '2021-01-01'
# For a datetime.datetime obj:
datetime.datetime.strptime(date, '%Y-%m-%d')
# For a datetime.date obj:
datetime.datetime.strptime(date, '%Y-%m-%d').date()
Posted by: Guest on September-13-2021
0

strptime python

import datetime
d = datetime.datetime.strptime("01/27/2012", "%m/%d/%Y")
print(d)
output ....
2012-01-27 00:00:00
Posted by: Guest on October-08-2020

Python Answers by Framework

Browse Popular Code Answers by Language