Retrieving Current Date and Time in Python

  • Share this:

Code introduction


Returns the current date and time.


Technology Stack : datetime

Code Type : Function

Code Difficulty :


                
                    
import datetime

def get_current_time():
    return datetime.datetime.now()                
              
Tags: