• VMware

    Learn about VMware virtualization for its products like vsphere ESX and ESXi, vCenter Server, VMware View, VMware P2V and many more

  • Linux

    Step by step configuration tutorials for many of the Linux services like DNS, DHCP, FTP, Samba4 etc including many tips and tricks in Red Hat Linux.

  • Database

    Learn installation and configuration of databases like Oracle, My SQL, Postgresql, etc including many other related tutorials in Linux.

  • Life always offers you a second chance ... Its called tomorrow !!!

    Saturday, August 18, 2012

    How to set or change date and time in Linux

    Here I will show you some steps to set or change the date and time of your Linux machine using CLI

    To view the currently set date and time on your linux machine# date
    To only view the date on your local Linux machine
    # date +%D
    To only view the time on your local Linux machine
    # date +%T
     Now to change the date and time at once
    # date --set "18 Aug 2012 12:39:36"
    where
    18 : date
    Aug : Month
    2012 : Year
    12 : Hour
    39 : Minute
    36 : Second

    Now if you only want to change the date or time
    To change date
    # date +%D -s "20120818"
    To change time
    # date +%T -s "12:48:20"
    All the above commands can also be practiced using --set parameter
    For example"
    # date --set "18 Aug 2012 12:39:36"
    # date +%D --set "20120818"
    # date +%T --set "12:48:20"


    Follow the below links for more tutorials

    0 comments:

    Post a Comment