Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-17-2018, 06:34 PM
|
#1
|
Member
Registered: Jul 2014
Posts: 41
Rep: 
|
Changing the Linux server date to future
Hi,
I have tried changing the date of the linnux machine to past which is happening but not to the future
Code:
date -s "19 APR 2012 11:14:00"
with the above command we can set it to that date but i want it to be for the year 2019
it is just displays when i replace 2012 with 2019 and later it is to the current date and time
Last edited by James0806; 07-17-2018 at 06:36 PM.
|
|
|
07-17-2018, 07:21 PM
|
#2
|
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 20,016
|
There's a good chance the machine is set to sync from a time server in the internet.
Whyever would you want to do this?
|
|
|
07-19-2018, 10:49 AM
|
#3
|
Member
Registered: Jul 2014
Posts: 41
Original Poster
Rep: 
|
The ntp service was disabled and as said we could change the date to past date but not to the future date.
I wanted to change it to the year 2019
|
|
|
07-19-2018, 11:21 AM
|
#4
|
Moderator
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,968
|
Are you saying that it just doesn't happen and you receive no error when you issue the command?
Because I do that on systems that have no real time clock nor NTP service.
You set the date. And since every date from 00:01 1/1/1900 is a future date, it just works.
|
|
|
07-21-2018, 10:05 AM
|
#5
|
LQ Guru
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
|
Maybe you could try setting it in the bios.
|
|
|
07-21-2018, 08:33 PM
|
#6
|
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 20,016
|
I think AwesomeMachine is onto something. After you set the software date, try running
and let us know what happens.
From the man page for hwclock:
Quote:
-w, --systohc
Set the Hardware Clock from the System Clock, and update the timestamps in /etc/adjtime. When the --update-drift option is given, then also (re)calculate the drift factor.
|
Last edited by frankbell; 07-21-2018 at 08:36 PM.
|
|
|
All times are GMT -5. The time now is 07:26 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|