LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 11-17-2003, 11:07 PM   #1
Neorio
Member
 
Registered: Jun 2003
Distribution: Debian
Posts: 110

Rep: Reputation: 15
'date' command format


I'm having a hell of a time trying to use the 'date' command to set the time on my box. The man page is just confusing. Can someone give me an example of how to use 'date' to set the time?

Last edited by Neorio; 11-17-2003 at 11:08 PM.
 
Old 11-18-2003, 01:24 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,744
Blog Entries: 54

Rep: Reputation: 2973Reputation: 2973Reputation: 2973Reputation: 2973Reputation: 2973Reputation: 2973Reputation: 2973Reputation: 2973Reputation: 2973Reputation: 2973Reputation: 2973
As root: "date --set='100 years ago'"
 
Old 11-18-2003, 10:19 AM   #3
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
You can test it with the "-d" flag to make sure. This will spit out the date according to the entered string. Once you've got the one you want, change the "-d" to a "-s" and the date's set.
 
Old 01-18-2011, 06:18 AM   #4
l.medoshvili
LQ Newbie
 
Registered: Dec 2010
Location: თბილისი
Posts: 3

Rep: Reputation: 0
Quote:
Originally Posted by Neorio View Post
I'm having a hell of a time trying to use the 'date' command to set the time on my box. The man page is just confusing. Can someone give me an example of how to use 'date' to set the time?
Code:
date -s "11/20/2003 12:48:00"
with this command you can set date and time
if you want to set only time than use next:

Code:
date -s "12:48:00"
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Format and Locale candyman123 Linux - Software 7 01-04-2006 12:58 AM
Need workaround for Date Format Cyberdyne Slackware 2 07-22-2005 05:36 AM
A question regarding the date format marsques Linux - General 1 03-12-2005 06:28 PM
Date format Mik LQ Suggestions & Feedback 8 12-05-2004 11:14 AM
MySQL date format mnauta Linux - General 2 05-13-2004 07:20 PM


All times are GMT -5. The time now is 03:10 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration