Re: Macros for time magic values

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Macros for time magic values
Date: 2011-03-14 16:42:58
Message-ID: 201103141642.p2EGgwx27328@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian wrote:
> > Yeah, I agree. And I do think that there is also some value of having
> > constants for SECS_PER_MINUTE and MINUTES_PER_HOUR, because otherwise
> > it can be unclear what 60 means in a particular context. We're at
> > the high end of what I consider reasonable in terms of defining
> > constants to represent values that aren't likely to change, but there
> > is tangible value in being able to grep for those constants when
> > you're trying to figure out what things might need changing, or just
> > to understand the code better.
>
> Yes, I did have to study the code to figure out which to use:
>
> if (type == TZ || type == DTZ)
> {
> tz = -(val * MINS_PER_HOUR);
> result = dt2local(timestamp, tz);
> }
>
> We measure timezone differences in minutes.

Let me also add that I realize I am often a royal pain in the neck.

There is no smiley on that --- I know I am often chaotic in how I
approach things and push them forward. I do my best, but that is often
the outcome.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2011-03-14 16:52:39 Re: Macros for time magic values
Previous Message Bruce Momjian 2011-03-14 16:36:36 Re: Macros for time magic values