Skip to main content

adjust_timestamp

Adjust timestamp based on provided utcoffset.

def adjust_timestamp(
ts: float,
offset: int,
here: Callable[..., float] = utcoffset
) - > float

Adjust timestamp based on provided utcoffset.

Parameters

NameTypeDescription
tsfloatThe original Unix timestamp to be adjusted.
offsetintThe target UTC offset in hours to apply to the timestamp.
hereCallable[..., float] = utcoffsetA callable that returns the current local UTC offset in hours; defaults to the utcoffset function.

Returns

TypeDescription
floatThe adjusted Unix timestamp in seconds, shifted by the difference between the provided offset and the local UTC offset.