Re: Freezing localtimestamp and other time function on some value - Mailing list pgsql-general

From Tom Lane
Subject Re: Freezing localtimestamp and other time function on some value
Date
Msg-id 10572.1460484302@sss.pgh.pa.us
Whole thread Raw
In response to Re: Freezing localtimestamp and other time function on some value  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Freezing localtimestamp and other time function on some value
List pgsql-general
I wrote:
> 3. While I can see the point of wanting to, say, test weekend behavior
> on a weekday, I do not see how a value of now() that doesn't advance
> between transactions would represent a realistic test environment for
> an app with time-dependent behavior.

BTW, one possible way of meeting that particular requirement is to fool
with your timezone setting.

regression=# select timeofday();
              timeofday
-------------------------------------
 Tue Apr 12 14:01:53.254286 2016 EDT
(1 row)

regression=# set time zone interval '+120 hours';
SET
regression=# select timeofday();
              timeofday
--------------------------------------
 Sun Apr 17 18:01:58.293623 2016 +120
(1 row)

            regards, tom lane


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Freezing localtimestamp and other time function on some value
Next
From: Juan Carlos Michaca Lucero
Date:
Subject: Re: Table seems empty but its size is in gigabytes