?
Solved

Set Date in Linux

Posted on 2002-03-31
10
Medium Priority
?
849 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 5

Accepted Solution

by:
paulqna earned 200 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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 

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
 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.
Suggested Courses
Course of the Month11 days, 9 hours left to enroll

752 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