LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 12-21-2003, 07:37 AM   #1
mairul
Member
 
Registered: Sep 2003
Location: In front of my LAN
Distribution: Redhat
Posts: 82

Rep: Reputation: 15
Date and Time


I am using Debian GNU LInux 3.0...

How can I set my date and time again from my console mode....

..................
 
Old 12-21-2003, 09:40 AM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
With the date command:
man date

Or to sync with a time server:
rdate -s time.nist.gov
or
ntpdate -s time.nist.gov
 
Old 12-23-2003, 02:36 PM   #3
mairul
Member
 
Registered: Sep 2003
Location: In front of my LAN
Distribution: Redhat
Posts: 82

Original Poster
Rep: Reputation: 15
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....
 
Old 12-23-2003, 02:49 PM   #4
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
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...
 
Old 12-23-2003, 02:54 PM   #5
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
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`"
 
Old 12-23-2003, 02:57 PM   #6
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
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..
 
Old 12-23-2003, 11:39 PM   #7
mairul
Member
 
Registered: Sep 2003
Location: In front of my LAN
Distribution: Redhat
Posts: 82

Original Poster
Rep: Reputation: 15
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.
 
Old 12-25-2003, 01:26 PM   #8
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Take a look at this thread:
http://www.linuxquestions.org/questi...hreadid=115354
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Start Date + Time Duration = End Date/Time calculator? ToBe Linux - General 3 09-26-2005 11:17 AM
date and time osheasf Linux - Software 1 06-15-2005 08:47 AM
date/time in c++ 1337 Twinkie Programming 3 01-01-2005 01:23 AM
Display the date and time from another time zone lothario Linux - Software 4 07-31-2004 04:27 PM
Date and time. vexer Slackware 2 08-13-2003 11:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 01:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration