As mentioned, the same logic should hold. last_access
is a little tricky though. I mentioned in the answer that it's updated before the logged in event is triggered.
So you'll need to use a different event.
I think the bootstrap event should handle that situation.
I can't remember what the name of it is off the top of my head.
I would experiment with different events that trigger at different parts of the page request pipeline to see what fits for your user activity you're trying to alert on.
Fundamentally, the strtotime
midnight logic should hold, it's just a matter of capturing the right timestamp at the right event.