The difference between from datetime import datetime and normal import datetime is that , you are dealing with a module at one time and a class at other.
The strptime function only exists in the datetime class so you have to import the class with the module otherwise you have to specify datetime twice when calling this function.
The thing here is that , the class name and the module name has been given the same name so it creates a bit of confusuion.