MCPcopy
hub / github.com/celery/celery / utcoffset

Function utcoffset

celery/utils/time.py:433–439  ·  view source on GitHub ↗

Return the current offset to UTC in hours.

(
        time: ModuleType = _time,
        localtime: Callable[..., _time.struct_time] = _time.localtime)

Source from the content-addressed store, hash-verified

431
432
433def utcoffset(
434 time: ModuleType = _time,
435 localtime: Callable[..., _time.struct_time] = _time.localtime) -> float:
436 """Return the current offset to UTC in hours."""
437 if localtime().tm_isdst:
438 return time.altzone // 3600
439 return time.timezone // 3600
440
441
442def adjust_timestamp(ts: float, offset: int,

Callers 3

test_utcoffsetMethod · 0.90
publishMethod · 0.90
sendMethod · 0.90

Calls

no outgoing calls

Tested by 1

test_utcoffsetMethod · 0.72