def localtime_string(datetime=None):
        """Converts an object to a local time string for form input."""
        reset_format_cache()
        datetime_format = get_format("DATETIME_INPUT_FORMATS")[0]
        return timezone.localtime(datetime).strftime(datetime_format)
Converts an object to a local time string for form input.
core/tests/tests_forms.py