Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.misc > #12520

Re: time problem

From Rich <rich@example.invalid>
Newsgroups comp.os.linux.misc
Subject Re: time problem
Date 2014-10-27 12:21 +0000
Organization My Linux Box
Message-ID <m2ldcf$hv6$1@dont-email.me> (permalink)
References (6 earlier) <m2i6qd$nta$1@reader1.panix.com> <m2j4r5$n7b$1@dont-email.me> <m2ki28$q6b$1@reader1.panix.com> <m2l6cg$qpq$1@dont-email.me> <m2lcb2$7p7$1@reader1.panix.com>

Show all headers | View raw


JohnF <john@please.see.sig.for.email.com> wrote:

> Yeah, I'll keep /etc/hardwareclock UTC. I think this probably means I
> can no longer just clock -w after date MMDDhhmm using edt time, but
> rather have to separately hwclock --set --date="yyyy-mm-dd hh:mm:ss"
> using utc time.

You can still use "date" to set Linux's system time.

And you can still use hwclock (note, no 'clock' command) to set the
hardware clock from the system time.  Just always give it the --utc
switch when you ask it to set the hardware from the system (the "write"
option) and things will be good.

> But I'll wait to see what happens next time I do it.
> Maybe that --utc switch will automatically adjust the clock -w
> effect,

Yes, giving hwclock the --utc flag means it will put the correct
physical H:M:S values into the hardware clock.

> >> > Why not?  It means your computer clock will always be set
> >> > correctly.
> > 
> >> I don't always have the box on the internet. 90% of the time I'm just
> >> editing stuff, and the box is standalone (except for my lan with some
> >> NAS's for backup). Box almost always boots standalone.
> > 
> > Does the "lan" not have a gateway to the internet on it?  If so, when
> > the machine's on the "lan" it also has "internet access".

> My broadband's a pretty slow verizon dsl, and the dsl modem's
> powered down when not in use (I'm not using its router functions,
> which are disabled). So the lan's on its own, for sure.
> No gateway, per se. Everything's just plugged into a switch,
>      +--------+     +---------+
>      |        |-----|dsl modem|-----telephone line
>      |        |     +---------+   +---------------+
>      | big GB |-------------------|router with wap|
>      | switch |     +---------+   +---------------+
>      |        |-----|computers|
>      |        |     +---------+   +------------+
>      |        |-------------------| NAS's, etc |
>      +--------+                   +------------+

Technically, given the above diagram, when you do power it up and talk
to the "internet" from "computers" via "big GB switch" you are actually
"using it's rounter functions".  In that arrangement, it is acting as a
"router" for your local lan.

> Okay, so now the above seems to suggest clock -w --localtime if
> /etc/localtime is EDT while /etc/hardwareclock is UTC, whereas I
> (probably incorrectly) interpreted your earlier remarks to suggest
> clock -w --utc for this situation. But I'm sure that trying it every
> which way will quickly resolve my mistake, one way or the other.

No, no, no.....

Don't try to overthink it.  The usage is actually simple:

  If /etc/hardwareclock says "UTC", then always give the hwclock
  command the --utc flag when you use hwclock to set/read the hardware.

  If /etc/hardwareclock says "localtime", then always give the hwclock
  command the --localtime flag when you use hwclock to set/read the
  hardware.

You don't have to concern yourself with when offsets get
added/subtracted if you do the above.  The developer writing hwclock
has to concern himself with those details, but you can ignore them.

And, given that Linux/Unix'es work best from a UTC basis, just set
/etc/hardwareclock to say UTC, and always give the --utc flag to the
hwclock command, and everything should be ok.

Back to comp.os.linux.misc | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

time problem "Bill Cunningham" <nospam@nspam.invalid> - 2014-10-25 18:24 -0400
  Re: time problem Grant <omg@grrr.id.au> - 2014-10-26 11:02 +1100
    Re: time problem "Bill Cunningham" <nospam@nspam.invalid> - 2014-10-25 20:30 -0400
  Re: time problem Baho Utot <baho-utot@columbus.rr.com> - 2014-10-25 20:06 -0400
  Re: time problem philo  <philo@privacy.net> - 2014-10-25 19:53 -0500
    Re: time problem "Bill Cunningham" <nospam@nspam.invalid> - 2014-10-25 21:02 -0400
      Re: time problem Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> - 2014-10-25 18:20 -0700
        Re: time problem JohnF <john@please.see.sig.for.email.com> - 2014-10-26 03:31 +0000
          Re: time problem Rich <rich@example.invalid> - 2014-10-26 05:36 +0000
            Re: time problem JohnF <john@please.see.sig.for.email.com> - 2014-10-26 07:11 +0000
              Re: time problem Rich <rich@example.invalid> - 2014-10-26 15:43 +0000
                Re: time problem JohnF <john@please.see.sig.for.email.com> - 2014-10-27 04:35 +0000
                Re: time problem Rich <rich@example.invalid> - 2014-10-27 10:22 +0000
                Re: time problem JohnF <john@please.see.sig.for.email.com> - 2014-10-27 12:03 +0000
                Re: time problem Rich <rich@example.invalid> - 2014-10-27 12:21 +0000
                Re: time problem William Unruh <unruh@invalid.ca> - 2014-10-27 13:54 +0000
                Re: time problem JohnF <john@please.see.sig.for.email.com> - 2014-10-27 05:01 +0000
                Re: time problem Rich <rich@example.invalid> - 2014-10-27 10:23 +0000
                Re: time problem JohnF <john@please.see.sig.for.email.com> - 2014-10-27 12:11 +0000
                Re: time problem Rich <rich@example.invalid> - 2014-10-27 12:30 +0000
                Re: time problem William Unruh <unruh@invalid.ca> - 2014-10-27 13:58 +0000
                Re: time problem Rich <rich@example.invalid> - 2014-10-27 18:04 +0000
              Re: time problem William Unruh <unruh@invalid.ca> - 2014-10-26 16:13 +0000
                Re: time problem Chick Tower <c.tower@deadspam.com> - 2014-10-31 03:30 +0000
          Re: time problem William Unruh <unruh@invalid.ca> - 2014-10-26 16:02 +0000
            Re: time problem Andreas Kohlbach <oct14.5.ankman@spamgourmet.com> - 2014-10-26 17:48 -0400
              Re: time problem William Unruh <unruh@invalid.ca> - 2014-10-26 21:58 +0000
              Re: time problem "Nuno J. Silva (aka njsg)" <njsg@invalid.invalid> - 2014-10-27 08:47 +0000
                Re: time problem Andreas Kohlbach <oct14.5.ankman@spamgourmet.com> - 2014-10-27 17:20 -0400
            Re: time problem JohnF <john@please.see.sig.for.email.com> - 2014-10-27 04:45 +0000
    Re: time problem "Bill Cunningham" <nospam@nspam.invalid> - 2014-10-25 21:08 -0400
      Re: time problem philo  <philo@privacy.net> - 2014-10-26 07:15 -0500
  Re: time problem Balwinder S Dheeman <bdheeman.SANSPAM@outlook.com> - 2014-10-26 14:08 +0530
    Re: time problem Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2014-10-27 03:15 +0000
  Re: time problem William Unruh <unruh@invalid.ca> - 2014-10-26 15:53 +0000
  Re: time problem James Moe <jimoeDESPAM@sohnen-moe.com> - 2014-10-26 14:01 -0700
    Re: time problem Michael Baeuerle <michael.baeuerle@stz-e.de> - 2014-10-27 07:59 +0000
      Re: time problem Marc Haber <mh+usenetspam1118@zugschl.us> - 2014-10-27 13:31 +0100
        "iburst" option of ntpd (was: time problem) Michael Baeuerle <michael.baeuerle@stz-e.de> - 2014-10-28 08:23 +0000
          Re: "iburst" option of ntpd (was: time problem) Marc Haber <mh+usenetspam1118@zugschl.us> - 2014-10-28 10:14 +0100
            Re: "iburst" option of ntpd (was: time problem) William Unruh <unruh@invalid.ca> - 2014-10-28 21:10 +0000
          Re: "iburst" option of ntpd Chris Davies <chris-usenet@roaima.co.uk> - 2014-10-28 14:24 +0000

csiph-web