Skip to content

Commit 6db6c94

Browse files
committed
Add documentation on how to specify explicit timezone
1 parent a53d08a commit 6db6c94

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/pip/_internal/cli/cmdoptions.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,9 @@ def _handle_exclude_newer_than(
805805
Process a value provided for the --exclude-newer-than option.
806806
807807
This is an optparse.Option callback for the --exclude-newer-than option.
808+
809+
Parses an ISO 8601 datetime string. If no timezone is specified in the string,
810+
local timezone is used.
808811
"""
809812
if value is None:
810813
return None
@@ -823,7 +826,12 @@ def _handle_exclude_newer_than(
823826
action="callback",
824827
callback=_handle_exclude_newer_than,
825828
type="str",
826-
help="Exclude packages newer than given time. This should be an ISO 8601 string.",
829+
help=(
830+
"Exclude packages newer than given time. This should be an ISO 8601 string. "
831+
"If no timezone is specified, local time is used. "
832+
"For consistency across environments, specify the timezone explicitly "
833+
"e.g., '2023-01-01T00:00:00Z' for UTC or '2023-01-01T00:00:00-05:00' for UTC-5."
834+
),
827835
)
828836

829837
no_build_isolation: Callable[..., Option] = partial(

0 commit comments

Comments
 (0)