I am trying to get current local time as a string in the format: year-month-day hour:mins:seconds. Which I will use for logging. By my reading of the documentation I can do
You can alternatively use time.strftime:
time.strftime('{%Y-%m-%d %H:%M:%S}')