from datetime import datetime def now(): """Returns a string for the current day and time the format YYYY-MM-DD HH:MM:SS is like the internet format""" now = datetime.now() return now.strftime("%Y-%m-%d %H:%M:%S") # like the internet standard # the following code is only executed if this file is invoked from the # command line as a script, rather than loaded as a module. if __name__ == '__main__': print(now())