With Lightspeed, the trading day ends at 8pm ET. If you bought a stock the trading day before X-Date, and at end of the day you have that long, you will get the dividend on the pay date.
Yes. The NMCES hours are from 4AM to 8PM. So considering T+2, and the record date is on the day after Ex, you will get the dividend if you buy one business day before the Ex date. Even if it's at 7:59PM (Record date being 2 days after purchase, and 1 day after Ex).
But this got me curious, and a couple of articles said it matters what exchange you are trading on. I think you're ok in the U.S. with T+2, but always look into the record date relative to the ex date, depending on the stocks and the exchange. This info is everywhere on the internet.