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

Function datetime

src/pendulum/__init__.py:126–152  ·  view source on GitHub ↗

Creates a new DateTime instance from a specific date and time.

(
    year: int,
    month: int,
    day: int,
    hour: int = 0,
    minute: int = 0,
    second: int = 0,
    microsecond: int = 0,
    tz: str | float | Timezone | FixedTimezone | _datetime.tzinfo | None = UTC,
    fold: int = 1,
    raise_on_unknown_times: bool = False,
)

Source from the content-addressed store, hash-verified

124
125# Public API
126def datetime(
127 year: int,
128 month: int,
129 day: int,
130 hour: int = 0,
131 minute: int = 0,
132 second: int = 0,
133 microsecond: int = 0,
134 tz: str | float | Timezone | FixedTimezone | _datetime.tzinfo | None = UTC,
135 fold: int = 1,
136 raise_on_unknown_times: bool = False,
137) -> DateTime:
138 """
139 Creates a new DateTime instance from a specific date and time.
140 """
141 return DateTime.create(
142 year,
143 month,
144 day,
145 hour=hour,
146 minute=minute,
147 second=second,
148 microsecond=microsecond,
149 tz=tz,
150 fold=fold,
151 raise_on_unknown_times=raise_on_unknown_times,
152 )
153
154
155def local(

Callers 15

localFunction · 0.85
from_formatFunction · 0.85
from_timestampFunction · 0.85
__new__Method · 0.85
__init__Method · 0.85
_normalizeFunction · 0.85
_parse_commonFunction · 0.85
test_precise_diffFunction · 0.85
dtFunction · 0.85
test_proper_dstFunction · 0.85

Calls 1

createMethod · 0.80

Tested by 15

test_precise_diffFunction · 0.68
dtFunction · 0.68
test_proper_dstFunction · 0.68
test_subtractionFunction · 0.68
test_equal_to_trueFunction · 0.68
test_equal_to_falseFunction · 0.68
test_not_equal_to_trueFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…