[openstack-dev] [ceilometer] database timestamps timezones

David Ripton dripton at redhat.com
Fri Nov 2 15:27:43 UTC 2012


On 11/01/2012 11:00 PM, John Tran wrote:
> Looking over https://bugs.launchpad.net/ceilometer/+bug/1048647, we'd
> like some feedback on timezone aware datetimes for the timestamp
> fields (in Meters and Resources tables).  From what I understand, some
> backends do not support timezone in timestamp type fields , such as
> MongoDB and Postgres.  I think the way Nova handles it is that it
> expects all timestamps in the database is expected to be UTC.

Postgres actually has separate types for timestamp without time zone and 
timestamp with time zone.

But I think it makes a lot more sense to just use UTC timestamps 
everywhere, rather than using timezone-aware timestamps which will 
involve more database-specific code.  If you care about the user's 
timezone, you can put it in a separate column.

-- 
David Ripton   Red Hat   dripton at redhat.com



More information about the OpenStack-dev mailing list