Skip to main content

check_within_window

Function check_within_window 

Source
pub fn check_within_window(
    current_timestamp: i64,
    start: i64,
    end: i64,
) -> ProgramResult
Expand description

Verify the current time is within an inclusive window [start, end].

Useful for auction periods, sale windows, or any operation that’s only valid during a specific time range.

let (_, now) = read_clock(clock_account)?;
check_within_window(now, auction.start_time, auction.end_time)?;