from datetime import datetime def time_formatted(t): return t.replace(microsecond=0).isoformat() def now(): return time_formatted(datetime.now())