Answer to Question #283357 in Python for ramk

Question #283357

 Create a Pandas program to create 

• Datetime object for Jan 15 2012. 

• Specific date and time of 9:20 pm. 

• Local date and time. 

• A date without time. 

• Current date. 

• Time from a datetime. 

• Current local time.



1
Expert's answer
2021-12-31T08:59:52-0500
import datetime
from datetime import datetime
print("Datetime object for Jan 11 2012:", datetime(2012, 1, 11))


print("\nSpecific date and time of 9:20 pm", datetime(2011, 1, 11, 21, 20)) 


print("\nLocal date and time:", datetime.now())


print("\nA date without time: ", datetime.date(datetime(2012, 5, 18)))


print("\nCurrent date:", datetime.now().date())


print("\nTime from a datetime:", datetime.time(datetime(2012, 12, 15, 18, 12)))


print("\nCurrent local time:", datetime.now().time()) 

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS