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.
|
|
08-23-2003, 03:48 AM
|
#1
|
Member
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511
Rep:
|
how set system time by command prompt?
how to set a system date using a command prompt?
let say i wan to set the system to be 2003, July, 05, 10:10... how?
|
|
|
08-23-2003, 04:09 AM
|
#2
|
Senior Member
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263
Rep:
|
you can do it with the date command, forgotten the argument though so you'll have to look in the man page.
man date
|
|
|
08-23-2003, 04:55 AM
|
#3
|
LQ Guru
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339
Rep:
|
for 2003, July, 05, 10:10
that should be:
date 070510102003
which means mm,dd,time,year
|
|
|
08-23-2003, 08:49 AM
|
#4
|
Member
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511
Original Poster
Rep:
|
okie... thanks... for help
|
|
|
08-23-2003, 09:00 AM
|
#5
|
Member
Registered: Aug 2003
Location: France
Distribution: SuSE 7.2/8.1/8.2/9.0/9.1
Posts: 81
Rep:
|
I use the command date -s
Example : to set date to the 21st august 2003
date -s 210803 +DDMMYY
^-------------^
format
date -s 1535 +HHMM sets time to 15:35
|
|
|
08-24-2003, 06:41 PM
|
#6
|
Member
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511
Original Poster
Rep:
|
then, how to display the two digits of the year?
|
|
|
08-24-2003, 06:48 PM
|
#7
|
Member
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511
Original Poster
Rep:
|
date +%Y will yield me a string 2003... if i want to display 03, then how?
|
|
|
08-24-2003, 06:48 PM
|
#8
|
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613
Rep:
|
I prefer NTP, or it's sister NTPdate. Works great! Check out www.ntp.org
Cool
|
|
|
08-25-2003, 02:53 AM
|
#9
|
Member
Registered: Aug 2003
Location: France
Distribution: SuSE 7.2/8.1/8.2/9.0/9.1
Posts: 81
Rep:
|
To display the last two digits of the current year
date +%y
(y lowercase=last two digits, Y uppercase=full year)
|
|
|
08-25-2003, 06:40 PM
|
#10
|
Member
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511
Original Poster
Rep:
|
oh....okie.... thanks for ur help
|
|
|
All times are GMT -5. The time now is 08:33 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
|
|