Skip to content

capturegraph.procedures.nodes.automatic.operators.time #

Time operator procedures perform calculations and manipulations on time values. These procedures enable time arithmetic, formatting, and conversion operations within workflows.

AddTimeInterval #

Bases: Procedure[PTime]

Adds 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 Procedure[PTime]

The base time to add the interval to

seconds Procedure[PNumber]

The number of seconds to add to the time

Source code in capturegraph-lib/capturegraph/procedures/nodes/automatic/operators/time.py
@make_procedure
class AddTimeInterval(Procedure[PTime]):
    """
    Adds 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 (Procedure[PTime]): The base time to add the interval to
        seconds (Procedure[PNumber]): The number of seconds to add to the time
    """

    time: Procedure[PTime]
    seconds: Procedure[PNumber]

GetBeginningOfDay #

Bases: Procedure[PTime]

Gets 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 Procedure[PTime]

The time to get the beginning of day for

Source code in capturegraph-lib/capturegraph/procedures/nodes/automatic/operators/time.py
@make_procedure
class GetBeginningOfDay(Procedure[PTime]):
    """
    Gets 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 (Procedure[PTime]): The time to get the beginning of day for
    """

    time: Procedure[PTime]

GetSecondsSince1970 #

Bases: Procedure[PNumber]

Converts a time to seconds since 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 Procedure[PTime]

The time to convert to Unix timestamp

Source code in capturegraph-lib/capturegraph/procedures/nodes/automatic/operators/time.py
@make_procedure
class GetSecondsSince1970(Procedure[PNumber]):
    """
    Converts a time to seconds since 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 (Procedure[PTime]): The time to convert to Unix timestamp
    """

    time: Procedure[PTime]

GetTimeDifferenceSeconds #

Bases: Procedure[PNumber]

Calculates the difference between two times in seconds.

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

Attributes:

Name Type Description
left Procedure[PTime]

The first (later) time

right Procedure[PTime]

The second (earlier) time

Source code in capturegraph-lib/capturegraph/procedures/nodes/automatic/operators/time.py
@make_procedure
class GetTimeDifferenceSeconds(Procedure[PNumber]):
    """
    Calculates the difference between two times in seconds.

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

    Attributes:
        left (Procedure[PTime]): The first (later) time
        right (Procedure[PTime]): The second (earlier) time
    """

    left: Procedure[PTime]
    right: Procedure[PTime]