Skip to main content

expiry_date_to_timestamp

Function expiry_date_to_timestamp 

Source
pub fn expiry_date_to_timestamp(underlying: &str, expiry: u64) -> i64
Expand description

Convert expiry date (YYYYMMDD format) to Unix timestamp.

§Arguments

  • underlying - Underlying symbol (e.g., “BTC”), used to resolve the configured expiry time of day
  • expiry - Expiry date in YYYYMMDD format (e.g., 20251231)

§Returns

Unix timestamp at the underlying’s configured UTC expiry time, or 0 if parsing fails.