MCPcopy Index your code
hub / github.com/python-pendulum/pendulum / datetime

Method datetime

src/pendulum/tz/timezone.py:141–158  ·  view source on GitHub ↗

Return a normalized datetime for the current timezone.

(
        self,
        year: int,
        month: int,
        day: int,
        hour: int = 0,
        minute: int = 0,
        second: int = 0,
        microsecond: int = 0,
    )

Source from the content-addressed store, hash-verified

139 return cast("_DT", dt.astimezone(self))
140
141 def datetime(
142 self,
143 year: int,
144 month: int,
145 day: int,
146 hour: int = 0,
147 minute: int = 0,
148 second: int = 0,
149 microsecond: int = 0,
150 ) -> _datetime.datetime:
151 """
152 Return a normalized datetime for the current timezone.
153 """
154 return self.convert(
155 _datetime.datetime(
156 year, month, day, hour, minute, second, microsecond, fold=1
157 )
158 )
159
160 def __repr__(self) -> str:
161 return f"{self.__class__.__name__}('{self.name}')"

Callers 15

_parseFunction · 0.45
DateTimeClass · 0.45
createMethod · 0.45
int_timestampMethod · 0.45
addMethod · 0.45
_cmpMethod · 0.45
parse_iso8601Function · 0.45
datetimeMethod · 0.45
_check_parsedMethod · 0.45
test_parseFunction · 0.45
test_precise_diffFunction · 0.45

Calls 1

convertMethod · 0.95

Tested by 15

test_parseFunction · 0.36
test_precise_diffFunction · 0.36
test_localeFunction · 0.36
test_diff_for_humansFunction · 0.36
test_diff_for_humansFunction · 0.36
test_diff_for_humansFunction · 0.36
test_diff_for_humansFunction · 0.36
test_diff_for_humansFunction · 0.36
test_diff_for_humansFunction · 0.36
test_formatFunction · 0.36
test_diff_for_humansFunction · 0.36