Set system date in terminal or script

Discussion in 'Linux' started by jknights, Jan 26, 2009.

  1. jknights

    jknights

    Joined:
    Nov 26, 2008
    Messages:
    88
    Likes Received:
    0
    Location:
    Oliva, Valencia, Spain
    I would like to be able to set my system time from the Terminal application to a particular time & date combination.

    Is there a script that I can run to do this?.

    I know about the date command but I dont seem to be able to use the right format to get it to work.
    I can use date '+%D' and it gives me system date but I want to set it using a script or from in the terminal.

    Please can somebody post an example or tell me where/how/what to do this.



    Thanks
    Jonathan
     
    jknights, Jan 26, 2009
    #1
  2. jknights

    daldred

    Joined:
    Aug 25, 2008
    Messages:
    887
    Likes Received:
    0
    daldred, Jan 26, 2009
    #2
  3. jknights

    jknights

    Joined:
    Nov 26, 2008
    Messages:
    88
    Likes Received:
    0
    Location:
    Oliva, Valencia, Spain

    Thanks.
    That looks right. I have not been using that format.


    Works like a dream.

    The AAO screen goes black (but not every time) while the system clock is set then it is OK. Time is reset.
    Now I need to make some scripts.

    Thank you very very much.
     
    jknights, Jan 26, 2009
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.