Function Name:
fromisoformat
Function Signature:
@classmethod fromisoformat(date_string)
Parameters:
date_string – The date string in ISO format – yyyy-mm-dd
Function Overview:
- The class method fromisoformat() from the date class of Python datetime module, constructs a date object from a string containing date in ISO format. i.e., yyyy-mm-dd.
Example:
# Example Python program that constructs a date object import datetime # Birth day of Picaso # Construct a datetime.date object # Print the type |
Output:
Birth day of Picaso: 1881-10-25 <class 'datetime.date'> |