JM プロジェクトは、主に Linux 関連のマニュアルページの日本語ページを翻訳・公開しています。
... って取得するものである。 #include < stdio.h > #include < stdlib.h > #include < string.h > struct mi { int nr; char *name; } months[] = { { 1, "jan" }, { 2, "feb" }, { 3, "mar" }, { 4, "apr" }, { 5, "may" }, { 6, "jun" }, { 7, "jul" }, { 8, "aug" }, { 9, ... "sep" }, {10, "oct" }, {11, "nov" }, {12, "dec" } }; #define nr_of_months (sizeof(months)/sizeof(months[0])) static int compmi(const void *m1, const void *m2) { const struct mi *mi1 = m1; const st ... ruct mi *mi2 = m2; return strcmp(mi1->name, mi2->name); } int main(int argc, char **argv) { qsort(months, nr_of_months, sizeof(months[0]), compmi); for (int i = 1; i < argc; i++) { struct mi key; struct mi *res; key.name = argv ... ... て正常終了する。 例 一昨日の日付を表示するには: date --date '2 days ago' 3 ヶ月と 1 日後の日付を表示するには: date --date '3 months 1 day' 今年のクリスマスが年の初めから何日目かを表示するには: date --date '25 Dec' +%j 完全な月名と日付からなる書式で今日を ... ... -1 , --one あるひと月のみを表示する (これがデフォルトである)。 -3 , --three 指定された日付を挟む 3 ヶ月を表示する。 -n , --months number 指定された日付を含む月から始まる number ヶ月を表示する。 -S, --span 指定された日付を挟む数ヶ月を表示する (訳注: -3 ... 日本語の文書やマニュアルを配布している個人/プロジェクトへのリンクです。