Skip to content

time

time #

Time operator procedures for calculations and manipulations on time values.

These procedures enable time arithmetic, formatting, and conversion operations within workflows.

TimeAddInterval #

Bases: Procedure[Time]

Add a time interval (in seconds) to a given time.

Creates a new timestamp by adding the specified number of seconds to the input time. Useful for scheduling, calculating future times, or creating time offsets in procedures.

Attributes:

Name Type Description
time Input[Time]

The base time to add the interval to.

interval_seconds Input[Number]

The number of seconds to add.

Source code in capturegraph-lib/capturegraph/procedures/nodes/process/operators/time.py
@make_procedure
class TimeAddInterval(Procedure[Time]):
    """Add a time interval (in seconds) to a given time.

    Creates a new timestamp by adding the specified number of seconds
    to the input time. Useful for scheduling, calculating future times,
    or creating time offsets in procedures.

    Attributes:
        time: The base time to add the interval to.
        interval_seconds: The number of seconds to add.
    """

    time: Input[Time]
    interval_seconds: Input[Number]

TimeBeginningOfDay #

Bases: Procedure[Time]

Return the beginning of the day (midnight) for a given time.

Truncates the time portion and returns the start of the same day (00:00:00). Useful for date-only comparisons and day-based grouping of data.

Attributes:

Name Type Description
time Input[Time]

The time whose day start is returned.

Source code in capturegraph-lib/capturegraph/procedures/nodes/process/operators/time.py
@make_procedure
class TimeBeginningOfDay(Procedure[Time]):
    """Return the beginning of the day (midnight) for a given time.

    Truncates the time portion and returns the start of the same day
    (00:00:00). Useful for date-only comparisons and day-based grouping
    of data.

    Attributes:
        time: The time whose day start is returned.
    """

    time: Input[Time]

TimeDifferenceSeconds #

Bases: Procedure[Number]

Calculate the difference between two times in seconds.

Subtracts the right time from the left time and returns the result in seconds (left - right). Positive values indicate left is later than right.

Attributes:

Name Type Description
left Input[Time]

The minuend time.

right Input[Time]

The subtrahend time.

Source code in capturegraph-lib/capturegraph/procedures/nodes/process/operators/time.py
@make_procedure
class TimeDifferenceSeconds(Procedure[Number]):
    """Calculate the difference between two times in seconds.

    Subtracts the right time from the left time and returns the result in
    seconds (``left - right``). Positive values indicate ``left`` is later
    than ``right``.

    Attributes:
        left: The minuend time.
        right: The subtrahend time.
    """

    left: Input[Time]
    right: Input[Time]

TimeToEpochSeconds #

Bases: Procedure[Number]

Convert a time to seconds since the Unix epoch (January 1, 1970).

Returns the timestamp as a number representing seconds elapsed since the Unix epoch. Useful for time calculations, comparisons, and interoperability with systems that use Unix timestamps.

Attributes:

Name Type Description
time Input[Time]

The time to convert to a Unix timestamp.

Source code in capturegraph-lib/capturegraph/procedures/nodes/process/operators/time.py
@make_procedure
class TimeToEpochSeconds(Procedure[Number]):
    """Convert a time to seconds since the Unix epoch (January 1, 1970).

    Returns the timestamp as a number representing seconds elapsed
    since the Unix epoch. Useful for time calculations, comparisons,
    and interoperability with systems that use Unix timestamps.

    Attributes:
        time: The time to convert to a Unix timestamp.
    """

    time: Input[Time]