convert datetime to string in python

strftime is an instance method of the datetime class in python and is used to convert datetime objects to an explicit form of string [1]. Examples of such usages are as follows:

Convert datetime object to yyyy-mm-dd string type.

relevant_match.strftime("%Y-%m-%d")


Details of different string types can be found here.

Comments

Popular posts from this blog

sample code to retrieve webpage contents using selenium