Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pendulum/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def instance(
)


def now(tz: str | Timezone | None = None) -> DateTime:
def now(tz: str | float | Timezone | None = None) -> DateTime:
"""
Get a DateTime instance for the current date and time.
"""
Expand Down Expand Up @@ -259,7 +259,7 @@ def yesterday(tz: str | Timezone = "local") -> DateTime:
def from_format(
string: str,
fmt: str,
tz: str | Timezone = UTC,
tz: str | float | Timezone | None = UTC,
locale: str | None = None,
) -> DateTime:
"""
Expand Down
4 changes: 2 additions & 2 deletions pendulum/datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ def now(cls, tz: datetime.tzinfo | None = None) -> Self:

@overload
@classmethod
def now(cls, tz: str | Timezone | FixedTimezone | None = None) -> Self:
def now(cls, tz: str | float | Timezone | FixedTimezone | None = None) -> Self:
...

@classmethod
def now(
cls, tz: str | Timezone | FixedTimezone | datetime.tzinfo | None = None
cls, tz: str | float | Timezone | FixedTimezone | datetime.tzinfo | None = None
) -> Self:
"""
Get a DateTime instance for the current date and time.
Expand Down