UTCNOW() - What can we do with this?

expressions
(Colin) #1

Hmmm Somebody has sneaked in a new, exciting feature?

What can we do with this?

1 Like
(Philip Garrett) #2

NOW() returns the current local time. UTCNOW() returns the current UTC time,

Local time is convenient because it displays time in the local timezone basis that most people use day to day.

However, local time introduces problems for application developers.

  1. If your app needs to work across time zones, local time is ambiguous. If a meeting is occurring at 2:00 PM in one timezone it is occurring at a different hour in the other time zones.
  2. If you are using local time to remember the order that events occur, then the fall daylight saving transition perturbs the time order. At the fall time transition local time goes backward an hour. This can result in duplicate event times or out of order event times.

One way of dealing with these problems is to record times in UTC. Having UTCNOW() enables that.

3 Likes
(Steve Coile) #3

For those who don’t know what UTC is:

1 Like