Skip to content

laboneq.workflow.timestamps

Timestamps functions for LabOne Q workflows.

local_date_stamp(dt=None)

Returns a string formatted date stamp in the local timezone.

Parameters:

Name Type Description Default
dt datetime | None

The time use. If None, the current time is used.

None

Returns:

Type Description
str

THe datetime formatted as '%Y%m%d'.

Note

This function is used by the FolderStore to generate the date stamp used in the names of the per-day subfolders it creates.

local_now(dt=None)

Returns the given datetime in the local timezone.

Parameters:

Name Type Description Default
dt datetime | None

The time to convert to the local timezone. If None, the current time is used.

None

Returns:

Type Description
datetime

The time in the local timezone.

local_timestamp(dt=None)

Returns a string formatted timestamp in the local timezone.

Parameters:

Name Type Description Default
dt datetime | None

The time use. If None, the current time is used.

None

Returns:

Type Description
str

The datetime formatted as '%Y%m%dT%H%M%S'.

Note

This function is used by the FolderStore to generate the timestamp used in the names of the logbook folders it creates.

utc_now(timestamp=None)

Returns the given timestamp or the current time.

Uses UTC timezone.