time

Time utilities for the Pipecat framework.

This module provides utility functions for time handling including ISO8601 formatting, nanosecond conversions, and human-readable time string formatting.

pipecat.utils.time.time_now_iso8601() str[source]

Get the current UTC time as an ISO8601 formatted string.

Returns:

The current UTC time in ISO8601 format with millisecond precision.

pipecat.utils.time.seconds_to_nanoseconds(seconds: float) int[source]

Convert seconds to nanoseconds.

Parameters:

seconds – The number of seconds to convert.

Returns:

The equivalent number of nanoseconds as an integer.

pipecat.utils.time.nanoseconds_to_seconds(nanoseconds: int) float[source]

Convert nanoseconds to seconds.

Parameters:

nanoseconds – The number of nanoseconds to convert.

Returns:

The equivalent number of seconds as a float.

pipecat.utils.time.nanoseconds_to_str(nanoseconds: int) str[source]

Convert nanoseconds to a human-readable time string.

Parameters:

nanoseconds – The number of nanoseconds to convert.

Returns:

MM:SS.microseconds” format.

Return type:

A formatted time string in “H