Thread: How do I set the system time on production server?

How do I set the system time on production server?

From
Ken Corey
Date:
Hi All,

I've just realized that our (production, naturally) database's idea of the
current date/time is 24 hours and 14 minutes fast.  What a weird thing.

So, is there a way to set the date/time?  I've hit the mail archives,
searchable docs, gone through Bruce Momjian's book, hit google, even
sacrificed a few chickens just on the off chance, and found nothing.

Lots of queries about dates, times, or how to find the current system
time...but not how to SET the current system date.

Argh!  Help!

(P.S. I'd _love_ an RTFM answer as long as you tell me where the FM is...;^)

---
Ken Corey    CTO    Atomic Interactive, Ltd.    http://www.atomic-interactive.com


Re: How do I set the system time on production server?

From
"Marin Dimitrov"
Date:
----- Original Message -----
From: "Ken Corey" <ken.corey@atomic-interactive.com>


>
> Lots of queries about dates, times, or how to find the current system
> time...but not how to SET the current system date.
>

why don't u do it on a OS level? It seems weird that you want to fix a
hardware/OS problem (incorrect server time) from Postgres
   Marin

----
"...what you brought from your past, is of no use in your present. When
you must choose a new path, do not bring old experiences with you.
Those who strike out afresh, but who attempt to retain a little of the
old life, end up torn apart by their own memories. "





Re: How do I set the system time on production server?

From
Stephan Szabo
Date:
On Fri, 15 Mar 2002, Ken Corey wrote:

> Hi All,
>
> I've just realized that our (production, naturally) database's idea of the
> current date/time is 24 hours and 14 minutes fast.  What a weird thing.
>
> So, is there a way to set the date/time?  I've hit the mail archives,
> searchable docs, gone through Bruce Momjian's book, hit google, even
> sacrificed a few chickens just on the off chance, and found nothing.

If you're logged into a shell on the system is the time off there as well?
If so, use the OS's tools to change the date/time.




Re: How do I set the system time on production server?

From
"Ross J. Reedstrom"
Date:
Ken - 
Note that we're talking _system_ time, so you won't find the answer in
the RDBMS docs - it's in the underlying OS docs. You don't mention what
OS you're running, and what it's idea of the current time is, so we
can't help you very well. If it's some flavor of unix, try looking at
'man date'. Personally, I use ntp to keep my linux system sync'ed with
a timeserver on campus.

Ross

On Fri, Mar 15, 2002 at 05:29:32PM +0000, Ken Corey wrote:
> Hi All,
> 
> I've just realized that our (production, naturally) database's idea of the 
> current date/time is 24 hours and 14 minutes fast.  What a weird thing.
> 
> So, is there a way to set the date/time?  I've hit the mail archives, 
> searchable docs, gone through Bruce Momjian's book, hit google, even 
> sacrificed a few chickens just on the off chance, and found nothing.  
> 
> Lots of queries about dates, times, or how to find the current system 
> time...but not how to SET the current system date.
> 
> Argh!  Help!
> 
> (P.S. I'd _love_ an RTFM answer as long as you tell me where the FM is...;^)
> 
> ---
> Ken Corey    CTO    Atomic Interactive, Ltd.    http://www.atomic-interactive.com
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)


Re: How do I set the system time on production server?

From
Ian Barwick
Date:
On Friday 15 March 2002 18:29, Ken Corey wrote:
> Hi All,
>
> I've just realized that our (production, naturally) database's idea of the
> current date/time is 24 hours and 14 minutes fast.  What a weird thing.
>
> So, is there a way to set the date/time?  I've hit the mail archives,
> searchable docs, gone through Bruce Momjian's book, hit google, even
> sacrificed a few chickens just on the off chance, and found nothing.
>
> Lots of queries about dates, times, or how to find the current system
> time...but not how to SET the current system date.

Umm, the system date/time is generally the responsibility of your server
hardware / operating system. In a shell, what does 'date' say?


Ian Barwick

PS tip for all those who haven't tried it: do not attempt to sacrifice
chickens in your server room, the feathers tend to get stuck in the
ventilation.


Re: How do I set the system time on production server?

From
Oliver Elphick
Date:
On Fri, 2002-03-15 at 17:29, Ken Corey wrote:
Seeing this is dated 15th March, you may have hade a reply already, but
I haven't seen it. 

> Lots of queries about dates, times, or how to find the current system 
> time...but not how to SET the current system date.

As root:
 date 032017012002.32

will set the date to 2002-03-20 17:01:32

See the manual page for date.

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
    "I am crucified with Christ; nevertheless I live; yet      not I, but Christ liveth in me; and the life which I
now live in the flesh I live by the faith of the Son      of God, who loved me, and gave himself for me."
                       Galatians 2:20 
 



Re: How do I set the system time on production server?

From
Peter Eisentraut
Date:
Ken Corey writes:

> I've just realized that our (production, naturally) database's idea of the
> current date/time is 24 hours and 14 minutes fast.  What a weird thing.
>
> So, is there a way to set the date/time?

The system time is inherited from the operating system.  You can use
date(1) or maybe hwclock(8) to alter the system time.  On some systems it
is not recommended to change the system time because that messes up all
kinds of scheduling, so if you can afford it, reboot and change the time
in the BIOS.  You should find information in those man pages about the
recommended way to do it on your system.

-- 
Peter Eisentraut   peter_e@gmx.net



Re: How do I set the system time on production server?

From
"Andrew G. Hammond"
Date:
On Wed, Mar 20, 2002 at 12:22:13PM -0500, Peter Eisentraut wrote:
> Ken Corey writes:
>
> > I've just realized that our (production, naturally) database's idea of the
> > current date/time is 24 hours and 14 minutes fast.  What a weird thing.
> >
> > So, is there a way to set the date/time?
>
> The system time is inherited from the operating system.  You can use
> date(1) or maybe hwclock(8) to alter the system time.  On some systems it
> is not recommended to change the system time because that messes up all
> kinds of scheduling, so if you can afford it, reboot and change the time
> in the BIOS.  You should find information in those man pages about the
> recommended way to do it on your system.

A previous email mentioned ntp.  Personally, I'd use the
above approach and then maintain the clock with ntpdate.
This program references and ntp time server and gently
syncs your system clock to the one true time.  I prefer
this to running the ntp daemon propper, since that
strikes me as overkill on most systems, and it adds yet
another security issue to pay attention to.  Stick it as
a cron job every couple of hours or so and it'll keep
your clock in line.  Like all things ntp, you have to
set your system clock to GMT, but that shouldn't be a
problem unless you're running a braindead OS.  Anyway,
for a time gap as big as the one you mentioned, there's
probably no way to really fix it gently.

--
Andrew G. Hammond  mailto:drew@xyzzy.dhs.org  http://xyzzy.dhs.org/~drew/
56 2A 54 EF 19 C0 3B 43 72 69 5B E3 69 5B A1 1F              613-389-5481
5CD3 62B0 254B DEB1 86E0  8959 093E F70A B457 84B1
"To blow recursion you must first blow recur" -- me