Return local time as an aware datetime object. If called without arguments, return current time. Otherwise *dt* argument should be a datetime instance, and it is converted to the local time zone according to the system time zone database. If *dt* is naive (that is, dt.tzinfo is No
(dt=None)
| 477 | # |
| 478 | |
| 479 | def localtime(dt=None): |
| 480 | """Return local time as an aware datetime object. |
| 481 | |
| 482 | If called without arguments, return current time. Otherwise *dt* |
| 483 | argument should be a datetime instance, and it is converted to the |
| 484 | local time zone according to the system time zone database. If *dt* is |
| 485 | naive (that is, dt.tzinfo is None), it is assumed to be in local time. |
| 486 | |
| 487 | """ |
| 488 | if dt is None: |
| 489 | dt = datetime.datetime.now() |
| 490 | return dt.astimezone() |
nothing calls this directly
no test coverage detected
searching dependent graphs…