How find two weeks away expiry is reached as Today

Hello,

I am building a strategy today by selecting strike price of two weeks away and making call/put. So when the two weeks expiry day reaches as today, now I want to exit my all positions at end of the day.

Ex:

  • Assume today is Thu, May 2, 2024
  • So I will select 16 MAY 2024 Strike Price CALL/PUT ATMs and build my strategy
  • now when this 16th MAY reached and 3:25 PM I want to exit all my positions

so how to make universal exit for this above example.