Debian This forum is for the discussion of Debian Linux.
|
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.
|
|
12-21-2003, 07:37 AM
|
#1
|
Member
Registered: Sep 2003
Location: In front of my LAN
Distribution: Redhat
Posts: 82
Rep:
|
Date and Time
I am using Debian GNU LInux 3.0...
How can I set my date and time again from my console mode....
..................
|
|
|
12-21-2003, 09:40 AM
|
#2
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
With the date command:
man date
Or to sync with a time server:
rdate -s time.nist.gov
or
ntpdate -s time.nist.gov
|
|
|
12-23-2003, 02:36 PM
|
#3
|
Member
Registered: Sep 2003
Location: In front of my LAN
Distribution: Redhat
Posts: 82
Original Poster
Rep:
|
With the date command I am trying to set my date but failed...
I mean can you show me an example of how to set my date only..
say I am want to change my date from 24 to 25....
Thanks in advance....
|
|
|
12-23-2003, 02:49 PM
|
#4
|
Senior Member
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243
Rep:
|
Code:
date 12251950
hwclock -w
The first command set the date/time in the OS clock (12th month, 25th day, 19th hour, 50th minute). The second command stores the OS clock to the hardware clock. As already pointed out using man date would have told you all this.
HTH
Jamie...
|
|
|
12-23-2003, 02:54 PM
|
#5
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
Or if you want to just add 1 day on you could use:
date --set="`date|cut -d' ' -f1-2` $((`date|cut -d' ' -f3`+1)) `date|cut -d' ' -f4-6`"
|
|
|
12-23-2003, 02:57 PM
|
#6
|
Senior Member
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243
Rep:
|
I'd of used a variable to store the output of date myself Dave but yeah, you could do it that nice, straight forward way
cheers
Jamie..
|
|
|
12-23-2003, 11:39 PM
|
#7
|
Member
Registered: Sep 2003
Location: In front of my LAN
Distribution: Redhat
Posts: 82
Original Poster
Rep:
|
thanks....how can I view my date all the time at text mode...
I mean at my command prompt......
debian:/#[time]......here at time I want to view the current time .....
Last edited by mairul; 12-23-2003 at 11:41 PM.
|
|
|
12-25-2003, 01:26 PM
|
#8
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
|
|
|
All times are GMT -5. The time now is 01:07 AM.
|
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
|
|