-
Notifications
You must be signed in to change notification settings - Fork 1
/
date.1
101 lines (75 loc) · 3.11 KB
/
date.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
DATE(1) Human68k ITA TOOLBOX User's Manual DATE(1)
名称
date - システムの日付と時刻を表示/設定する
形式
date [ -u ] [ +format ]
date [ -u ] [[CC]YY]MMDDhhmm[.ss]
解説
date を引数なしで起動すると,現在のシステムの日付と時刻を,
後述の %c の形式で表示出力します.‘+’で始まる引数を与える
と format に従って書式化して表示出力します.format の各文字
のうち,文字‘%’で始まる変換指定記号は次のように変換され,
その他の文字はそのまま出力されます.
%% 文字‘%’.
%n 改行(CRLF).
%t 水平タブ.
%Y 年(1980..2079).
%y 年の下2桁(00..99).
%m 月(01..12).
%b 月の英語名称の頭 3文字(Jan..Dec).
%B 月の英語名称(January..December).
%h ‘%b’と同じ.
%U 日曜日を週の始まりとした,年の中での週(00..53).
%W 月曜日を週の始まりとした,年の中での週(00..53).
%j 年の中での日(001..366).
%d 日(01..31).
%e 日( 1..31).1桁では 1個のスペースが先行する.
%w 週の中での日(0..6).0 は日曜日.
%a 曜日の英語名称の頭3文字(Sun..Sat).
%A 曜日の英語名称(Sunday..Saturday).
%p ‘AM’か‘PM’.
%H 24時制での時(00..23).
%k 24時制での時( 0..23).1桁では 1個のスペースが先行する.
%I 12時制での時(01..12).
%l 12時制での時( 1..12).1桁では 1個のスペースが先行する.
%M 分(00..59).
%S 秒(00..59).
%D ‘%m/%d/%y’と同じ.
%T ‘%H:%M:%S’と同じ.
%R ‘%H:%M’と同じ.
%r ‘%I:%M:%S %p’と同じ.
%c ‘%a %b %d %T JST %Y’と同じ.
これら以外の変換指定記号がある場合はエラーとなります.
引数 [[CC]YY]MMDDhhmm[.ss] を与えると,これに従ってシステム
の日付と時刻が設定されて,上記の %c の形式で表示されます.引
数のそれぞれの桁は 2桁ずつの10進数で,CC は西暦で表した年の
上位 2桁,YY は下位 2桁,MM は月(01~12),DD は日(01~31),
hh は時(00~23),mm は分(00~59),ss は秒(00~59)の指
定です.年は 1980 から 2079 までが認められます.CC を省略し
て YY を指定した場合,80~99 は 1980~1999,00~79 は 2000~
2079 を表します.年のデフォルトは現在の年,秒のデフォルトは
00 です.
date はシステムの日付と時刻を日本標準時(JST)と見なします.
通常はこれをそのまま表示/設定しますが,-u オプションを指定
するとグリニッジ標準時(GMT)で表示/設定することができます.
関連事項
touch(1)
診断
何らかのエラーがあったときにはエラー・メッセージが標準エラー
出力に出力されます.
終了ステータスとしては,引数の記述に間違いがあった場合には 1,
メモリ不足など,システムの原因により正常に実行ができなかった
場合には 3,すべてが正常に終了したならば 0 が返ります.^C な
どによって中断したときの終了ステータスは OS の仕様によります.
注意
引数は単一でなければなりません.
制約
システムの仕様により,設定する年は JST において 1980 から
2079 までの範囲でなければなりません.
不具合
タイムゾーンやローケールには対応していません.
バージョン
1.1
制作・著作
Copyright(C)1993-95 by 板垣 史彦 (Itagaki Fumihiko)
1.1 Last change: 05 Jan 1995 Itagaki Fumihiko