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

Method set

src/pendulum/datetime.py:200–230  ·  view source on GitHub ↗
(
        self,
        year: int | None = None,
        month: int | None = None,
        day: int | None = None,
        hour: int | None = None,
        minute: int | None = None,
        second: int | None = None,
        microsecond: int | None = None,
        tz: str | float | Timezone | FixedTimezone | datetime.tzinfo | None = None,
    )

Source from the content-addressed store, hash-verified

198 # Getters/Setters
199
200 def set(
201 self,
202 year: int | None = None,
203 month: int | None = None,
204 day: int | None = None,
205 hour: int | None = None,
206 minute: int | None = None,
207 second: int | None = None,
208 microsecond: int | None = None,
209 tz: str | float | Timezone | FixedTimezone | datetime.tzinfo | None = None,
210 ) -> Self:
211 if year is None:
212 year = self.year
213 if month is None:
214 month = self.month
215 if day is None:
216 day = self.day
217 if hour is None:
218 hour = self.hour
219 if minute is None:
220 minute = self.minute
221 if second is None:
222 second = self.second
223 if microsecond is None:
224 microsecond = self.microsecond
225 if tz is None:
226 tz = self.tz
227
228 return self.__class__.create(
229 year, month, day, hour, minute, second, microsecond, tz=tz, fold=self.fold
230 )
231
232 @property
233 def float_timestamp(self) -> float:

Callers 15

onMethod · 0.95
atMethod · 0.95
_start_of_secondMethod · 0.95
_end_of_secondMethod · 0.95
_start_of_minuteMethod · 0.95
_end_of_minuteMethod · 0.95
_start_of_hourMethod · 0.95
_end_of_hourMethod · 0.95
_start_of_monthMethod · 0.95
_end_of_monthMethod · 0.95
_start_of_yearMethod · 0.95
_end_of_yearMethod · 0.95

Calls 1

createMethod · 0.80

Tested by

no test coverage detected