validate_timestamp

Function validate_timestamp 

Source
pub fn validate_timestamp(timestamp: i64) -> bool
Expand description

Validate timestamp is in expected microsecond range

Checks if timestamp falls within reasonable bounds for financial data. Expanded range (2000-2035) covers historical Forex data (2003+) and cryptocurrency data (2009+) while rejecting obviously invalid timestamps.

§Arguments

  • timestamp - Timestamp in microseconds (16-digit precision)

§Returns

true if timestamp is within valid range, false otherwise

§Validation Range (Q16)

  • MIN: 2000-01-01 (covers historical Forex from 2003)
  • MAX: 2035-01-01 (future-proof for upcoming data)
  • Rejects: Unix epoch (1970), far future (2100+), negative timestamps