Clarification needed on NOW() vs UTCNOW() and datetime math

I have users in multiple time zones. I need to add the ability to pull out data for a view based on when that user last used the app and what’s been added or changed since then.

My question is, should I be using UTCNOW() for the columns I am using for these calculations so the time is consistent across all users? It seems like if I used NOW() there would be inconsistencies.

See: UTCNOW() - What can we do with this?

0 4 169
4 REPLIES 4

Steve
Platinum 4
Platinum 4

So long as you’ve got localization setup properly, NOW() should work just fine.

I’ll trust you on this one, Steve. I have trouble wrapping my head around NOW() and time zones and time math.

As do I…

That makes me feel better! Thanks Steve.

Top Labels in this Space