ksaitoの日記

日々試したことの覚え書き

玄箱の時間を合わせる

移転しました。

自動的にリダイレクトします。

玄箱(というよりbusybox)のdateコマンドで日付を合わせる時に使えるフォーマットは、MMDDhhmmCCYYだけです。
久しぶりに使ったら、ちょっと手間取ってしまいました。

~ # date -s 101221202009
Mon Oct 12 21:20:00 JST 2009
~ # date -h
date: invalid option -- h
BusyBox v1.1.1 (2007.04.06-12:02+0000) multi-call binary

Usage: date [OPTION]... [MMDDhhmm[[CC]YY][.ss]] [+FORMAT]

Displays the current time in the given FORMAT, or sets the system date.

Options:
        -R              Outputs RFC-822 compliant date string
        -d STRING       Displays time described by STRING, not `now'
        -I[TIMESPEC]    Outputs an ISO-8601 compliant date/time string
                        TIMESPEC=`date' (or missing) for date only,
                        `hours', `minutes', or `seconds' for date and,
                        time to the indicated precision
        -D hint         Use 'hint' as date format, via strptime()
        -s              Sets time described by STRING
        -r FILE         Displays the last modification time of FILE
        -u              Prints or sets Coordinated Universal Time

$