Solved

Set Date in Linux

Posted on 2002-03-31
10
826 Views
Last Modified: 2013-12-16
Hello Linux Experts,

Perhaps I would like to ask how I can set date in linux ?
For eg, in Dos, we can use

C:>Date
   Current date is 0-03-2002
   Enter new date (mm-dd-yy) : _


So for linux how do we set it ?

Thank you
Derrick Koay
0
Comment
Question by:dekoay
10 Comments
 
LVL 5

Accepted Solution

by:
paulqna earned 50 total points
ID: 6910014
To enter a date for 25th of december at 23:15 do:

date 12252315

or do:

man date

to see all the other options available...

0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6910347
keep in mind that  date  , unlike to DOS' date, just sets the OS' time, the BIOS clock (RTC) remains unchanged.
Also see  man date  and check for the  -u  option.

If you want to st the RTC, see   man hwclock
0
 
LVL 4

Expert Comment

by:svindler
ID: 6927533
I strongly suggest you use ntp to set the time.
This automatically updates your clock, using publicly accessible time servers.
See www.ntp.org for more info.
0
 

Expert Comment

by:aman66
ID: 6967566
use command as below
1)date -s hh:mm:ss
2)/sbin/clock -w


explain:
1)modify time
2)write to Hardware Clock(BIOS)


http://linuxnews.idv.tw/
http://forum.linuxnews.idv.tw/
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 51

Expert Comment

by:ahoffmann
ID: 6967814
aman66, would you please post your suggestions as comments, and not as answers.
Let the questioner decide to grade the comment of her/his choice as answer.
Please read the EE Policies if unshure.
Thanks (no offence, just a kindly reminder)
0
 

Author Comment

by:dekoay
ID: 7010046
amanda66,

thanx for the answer, but what I need is to set both time and date. Paulqna answer is more accurate as I had solved the problem with its way.
0
 

Expert Comment

by:CleanupPing
ID: 9077040
dekoay:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 9077358
answer depends on the questioner's intent:
  - setting time/date in OS only --> date
     paulqna gave the answer
  - setting time/date in BIOS (independent of Linux): --> date -u   or  hwclock
     ahoffmann gave an answer
0
 
LVL 1

Expert Comment

by:drewber
ID: 9220348
This question has been classified abandoned. I will make a recommendation to the moderators on its resolution in a week or two. I appreciate any comments that would help me to make a recommendation.
 

Unless it is clear to me that the question has been answered I will recommend delete. It is possible that a Grade less than A will be given if no expert makes a case for an A grade. It is assumed that any participant not responding to this request is no longer interested in its final disposition.

 
If the user does not know how to close the question, the options are here:
http://www.experts-exchange.com/help/closing.jsp
 
drewber
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now