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


Groups > linux.debian.user > #229401

Re: setting the date for testing

From "hdv@gmail" <hdv.jadev@gmail.com>
Newsgroups linux.debian.user
Subject Re: setting the date for testing
Date 2020-12-06 22:00 +0100
Message-ID <Bj9ip-6Zm-5@gated-at.bofh.it> (permalink)
References <Bj98K-6W2-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2020-12-06 21:43, Michael Grant wrote:
> I need to set the date to several years in the future in order to test 
> something.  When I do this via the date command, the date returns back 
> almost instantly (or within a few seconds).
> 
> # timedatectl set-time 2025-12-06 20:41:41
> 
> # date
> 
> Sat  6 Dec 20:41:43 GMT 2025
> 
> # date
> 
> Sat  6 Dec 20:41:44 GMT 2025
> 
> # date
> 
> Sun  6 Dec 20:41:48 GMT 2020
> 
> I’m not using ntp (that I know of).
> 
> # timedatectl timesync-status
> 
> Failed to query server: The name org.freedesktop.timesync1 was not 
> provided by any .service files
> 
> # timedatectl show
> 
> Timezone=Europe/London
> 
> LocalRTC=no
> 
> CanNTP=no
> 
> NTP=no
> 
> NTPSynchronized=no
> 
> TimeUSec=Sun 2020-12-06 20:37:19 GMT
> 
> RTCTimeUSec=Sun 2020-12-06 18:51:22 GMT
> 
> How can I stop (temporarily) the system from automatically setting the 
> date so that I can set it forward?

I encountered this type of thing myself a while ago as well. And, just 
like you, I thought there was no NTP running, but systemd had some 
tricks upon its sleeve.

Try this to see if it solves your troubles:

# timedatectl set-ntp true

Changes to the status of this service will not be immediately noticed by 
timedatectl. Thus, you'll have to enter the following command too:

# systemctl restart systemd-timedated.service

HTH

Grx HdV

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

setting the date for testing Michael Grant <mgrant@grant.org> - 2020-12-06 21:50 +0100
  Re: setting the date for testing "hdv@gmail" <hdv.jadev@gmail.com> - 2020-12-06 22:00 +0100
  Re: setting the date for testing "hdv@gmail" <hdv.jadev@gmail.com> - 2020-12-07 09:00 +0100
    RE: setting the date for testing Michael Grant <mgrant@grant.org> - 2020-12-13 14:40 +0100
      Re: setting the date for testing "hdv@gmail" <hdv.jadev@gmail.com> - 2020-12-13 15:10 +0100
        Re: setting the date for testing Michael Grant <mgrant@grant.org> - 2020-12-13 16:40 +0100
          Re: setting the date for testing "hdv@gmail" <hdv.jadev@gmail.com> - 2020-12-13 17:00 +0100
  Re: setting the date for testing Michael Stone <mstone@debian.org> - 2020-12-07 15:30 +0100

csiph-web