Tuesday, March 30, 2010

#! Crunchbang Set the Time via Terminal CLI

From: http://wiki.debian.org/DateTime

Set the time manually via the terminal cli


When setting the time manually, the time string may be confusing. The command date --set ... accepts the date and time in many formats. You can read the ShUtils info document, or use the example below to figure out one possible format. The date is given in ISO 8601 standard format YYYY-MM-DD for Year-Month-DayOfMonth, and time of day using 24 hour clock. Leading zeros are significant.

Set the date
sudo date --set 2010-01-28

Set the time
sudo date --set 21:08:00

Restart Tint2 to see the correct time:
sudo killall tint2
tint2 &

2 comments:

  1. How do we set the time to 12 hour format?

    ReplyDelete
  2. Hi andrew,
    The system time is usually 24 hr clock, so you would have to set your specific time application to show a 12 hour clock.

    For example, if you use the Tint2 panel with a clock, you could edit the tintrc config file to show 12 instead of 24 hour clock. The same goes for most desktop clocks, you should be able to right-click on them and set the 12/24 hour format.

    See this for manually edited config files:
    http://www.manpagez.com/man/3/strftime/

    ReplyDelete

If you liked a post, please leave a comment.