473,698 Members | 2,370 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

setting local time without restarting server

Hi,

Is there a function that would allow me to set the local time while the
server is running? I can't seem to find anything on this...

Thanks,
Peter
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #1
4 4795
On Thu, May 13, 2004 at 12:56:48 -0600,
Anony Mous <A.****@shaw.ca > wrote:
Hi,

Is there a function that would allow me to set the local time while the
server is running? I can't seem to find anything on this...


You probably want to set the timezone, not the local time.
You can do that with something like:
SET TIMEZONE='EST5E DT';

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #2
Thanks, but I do want to set the system time.

It's actually for testing purposes. Our software looks to the db server to
obtain the local date and time, however, to test various cases we need to
fiddle with this value. I'd like to do it without having to first change
the system time, and then re-start the postmaster. Sorry, I should have
clarified this in my first e-mail.

-Peter

-----Original Message-----
From: Bruno Wolff III [mailto:br***@wo lff.to]
Sent: May 13, 2004 2:07 PM
To: Anony Mous
Cc: pg***********@p ostgresql.org
Subject: Re: [GENERAL] setting local time without restarting server

On Thu, May 13, 2004 at 12:56:48 -0600,
Anony Mous <A.****@shaw.ca > wrote:
Hi,

Is there a function that would allow me to set the local time while the
server is running? I can't seem to find anything on this...


You probably want to set the timezone, not the local time.
You can do that with something like:
SET TIMEZONE='EST5E DT';
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #3
On Thu, May 13, 2004 at 15:07:13 -0500,
Bruno Wolff III <br***@wolff.to > wrote:
On Thu, May 13, 2004 at 12:56:48 -0600,
Anony Mous <A.****@shaw.ca > wrote:
Hi,

Is there a function that would allow me to set the local time while the
server is running? I can't seem to find anything on this...


You probably want to set the timezone, not the local time.
You can do that with something like:
SET TIMEZONE='EST5E DT';


Thinking about this some more; this only changes it for the session not
the default for new sessions.

Reading the documentation suggests that you can set the timezone in the
config file and sighup the postmaster to get it to reread the config file.
It might also be possible to change the underlying system's timezone
and do a sighup to have it pick up the correct timezone.

If the underlying system has the correct timezone, but for some reason has
the wrong time, you should be able to change its time. How you do that
varies a bit from system to system. Under *nix systems you usually use
the 'date' command (if you aren't using ntp). Under Linux, at least,
you also want to run setclock to set the hardware clock to the right
time so the time is still correct after the next reboot.

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #4
Anony Mous <A.****@shaw.ca > writes:
Thanks, but I do want to set the system time.
You cannot do that from within Postgres, because it requires root
privileges.
I'd like to do it without having to first change
the system time, and then re-start the postmaster.


Who said anything about restarting the postmaster? Just set the system
time (eg, with date(1)).

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
4894
by: Harag | last post by:
Hi all I think this is in the wrong group but since I don't read others much or code in java script I was wondering if anyone could help me with this small problem, as I code mostly in ASP vbscript. I have the following piece of Javascript client code that displays the users clock on the browser and updates it every second.
0
1505
by: pwldev | last post by:
Sorry if this isn't a good place for this question. I have a problem with losing cookie values whenever a user's local machine date/time is behind the date & time of the IIS machine. The login page sets some cookie values (using Response.Cookies) and redirects to another page which then checks for the cookie values. I've noticed that when a user's local date/time is behind that of the IIS machine, the cookie values are always empty. I...
4
11864
by: Elie Grouchko | last post by:
Hi All 1. I need to convert the local-time of the server on which I run my website to UTC and I don't want to rely on the server local time and timezone (i.e. I don't want to hardcode the timezone information), is there a generic way to do this? 2. Is there a general for converting time between timezones in ASP? Many thanks
1
9882
by: thomasamillergoogle | last post by:
Hello, My sql server 2000 database is on a shared server that I have absolutely no control over. When i run query select getdate() it is reporting the wrong time! I am pretty sure that the sql admin changed the date on the server last night and now this is happening. Is this possible. Shouldn't getdate() ALWAYS report back the date time
0
1302
by: Bill Borg | last post by:
Hello all, I need to know the local time for users of a global system. Here's the scenario: My server (PDT time) hosts commerce for companies around the world. It's fair to assume that those companies' customers are all local to that company. With each transaction I get the current time, and store as UTC/GMT. But when I want to show the time back to the user, I want to show in *his* local time.
5
8044
by: rgrandidier | last post by:
I have a SQL table that stores the UTC time for a column, I then want to display the UTC time to the user in their local time. My approach is to have the user set their time zone via their user profile. Then to use that setting to convert the UTC date/time to the users local time. I am using C# via ASP.Net. Any suggestions? I thought I had found something using the CultureInfo class and Response.UserLanguages, however, this always...
3
8298
by: Si Chen | last post by:
Hello. It seems that every time I make a change to pg_hba.conf, I have to restart the database server for the new authentication to take effect. Is there a way to have the server use the new pg_hba.conf authentication without restarting the production server. Thanks, Si
3
23744
by: Randall Parker | last post by:
Suppose one has a database of UTC times that are from different dates in the past. The problem with translating those times to a local time is that one does not know for each UTC time whether the local time at that same moment had daylight savings time in effect. If one has a local time it is easier to translate it into UTC time. One can get the UTC time and one can even calculate the number of hours difference between them as follows: ...
2
1811
by: blast8180 | last post by:
I'm completely new to asp, coding, and scripting. I have a business background so I'm not familiar with this world at all. That said, I'd like some help on clarifying what this article is asking of me... http://classicasp.aspfaq.com/general/how-do-i-refresh-global-asa-without-restarting-the-application.html Given my global asa... <script language="vbscript" runat="server"> sub Application_OnStart
0
8674
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9026
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7723
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3045
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.