How to convert string into datetime?



How to convert string into datetime?..

Answer / Dheeraj Sharma

To convert a string into a datetime object in Python, you can use the datetime.strptime function. This function takes a format string as an argument and converts a given date/time string according to that format.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

Explain the difference between local and global namespaces?

1 Answers  


What are the rules for legal python names?

1 Answers  


What is type conversion in python?

1 Answers  


Is python zero indexed?

1 Answers  


What packages in the standard library, useful for data science work, do you know?

1 Answers  


How can I make a time delay in python?

1 Answers  


What is design pattern in python?

1 Answers  


How can you organize your code to make it easier to change the base class?

1 Answers  


How would you make a python script executable on unix?

1 Answers  


What are the differences between pass and continue?

1 Answers  


Who uses python?

1 Answers  


What are “special” methods in python?

1 Answers  


Categories