Browse Subversion Repository
Contents of /trunk/doc/jp/html/macro/command/gettime.html
Parent Directory
| Revision Log
Revision 3227 -
( show annotations)
( download)
( as text)
Tue Mar 24 15:10:33 2009 UTC
(15 years, 1 month ago)
by maya
File MIME type: text/html
File size: 2112 byte(s)
CVS から SVN へ移行: 改行コードを LF から CR+LF へ変換
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
2 |
"http://www.w3.org/TR/html4/strict.dtd"> |
3 |
<html> |
4 |
<head> |
5 |
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> |
6 |
<title>gettime</title> |
7 |
<meta http-equiv="Content-Style-Type" content="text/css"> |
8 |
<link rel="stylesheet" href="../../style.css" type="text/css"> |
9 |
</head> |
10 |
|
11 |
<body> |
12 |
|
13 |
|
14 |
<h1>gettime</h1> |
15 |
|
16 |
<p> |
17 |
現在の時刻を得る。 |
18 |
</p> |
19 |
|
20 |
<pre class="macro-syntax"> |
21 |
gettime <strvar> [<format>] |
22 |
</pre> |
23 |
|
24 |
<h2>解説</h2> |
25 |
|
26 |
<p> |
27 |
現在の時刻を文字列変数 <strvar> に <format> に従った形式で格納する。書式は <a href="http://msdn2.microsoft.com/ja-jp/library/fe06s4ak(VS.80).aspx">strftime</a> と同じ物が使える。<br> |
28 |
formatが省略された場合、格納される形式は"HH:MM:SS"となる。(<format> に %H:%M:%S を指定したのと同じ)<br> |
29 |
</p> |
30 |
|
31 |
<p> |
32 |
formatが指定されたgettimeは、同じformatが指定されたgetdateと動作が等しくなる。 |
33 |
</p> |
34 |
|
35 |
<p> |
36 |
formatが指定された場合、このコマンドの実行結果はシステム変数 result に格納される。 |
37 |
formatが指定されなかった場合は、変数 result の値は変更されない。 |
38 |
変数 result の値の意味は以下のとおり。 |
39 |
</p> |
40 |
|
41 |
<table> |
42 |
<thead> |
43 |
<tr> |
44 |
<th>値</th> |
45 |
<th>意味</th> |
46 |
</tr> |
47 |
</thead> |
48 |
|
49 |
<tbody> |
50 |
<tr> |
51 |
<td>0</td> |
52 |
<td> |
53 |
正常に値が <strvar> に格納された。 |
54 |
</td> |
55 |
</tr> |
56 |
|
57 |
<tr> |
58 |
<td>1</td> |
59 |
<td> |
60 |
生成された文字列の長さが上限(255文字)を超えた等の理由で、<strvar> への値の格納が正常に行われなかった。 |
61 |
</td> |
62 |
</tr> |
63 |
|
64 |
<tr> |
65 |
<td>2</td> |
66 |
<td> |
67 |
<format> の指定が不正である。 |
68 |
</td> |
69 |
</tr> |
70 |
</tbody> |
71 |
</table> |
72 |
|
73 |
<h2>例</h2> |
74 |
|
75 |
<pre class="macro-example"> |
76 |
;現在の時刻をtimestrに格納。形式はHH:MM:SS。 |
77 |
gettime timestr |
78 |
|
79 |
;現在の日時を元にしてログファイル名を生成し、変数logfileに格納。 |
80 |
;形式はlog-YYYYMMDD-HHMMSS.txt |
81 |
gettime logfile "log-%Y%m%d-%H%M%S.txt" |
82 |
</pre> |
83 |
|
84 |
<h2>参照</h2> |
85 |
<ul> |
86 |
<li><a href="getdate.html">getdate</a></li> |
87 |
<li><a href="http://msdn2.microsoft.com/ja-jp/library/fe06s4ak(VS.80).aspx">strftime (MSDNライブラリ)</a></li> |
88 |
</ul> |
89 |
|
90 |
</body> |
91 |
</html> |
|