Browse Subversion Repository
Annotation of /trunk/doc/en/html/macro/command/getdate.html
Parent Directory
| Revision Log
Revision 3227 -
( hide annotations)
( download)
( as text)
Tue Mar 24 15:10:33 2009 UTC
(15 years, 2 months ago)
by maya
File MIME type: text/html
File size: 2116 byte(s)
CVS から SVN へ移行: 改行コードを LF から CR+LF へ変換
1 |
maya |
3227 |
<!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=iso-8859-1"> |
6 |
|
|
<title>getdate</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>getdate</h1> |
15 |
|
|
|
16 |
|
|
<p> |
17 |
|
|
Gets current date. |
18 |
|
|
</p> |
19 |
|
|
|
20 |
|
|
<pre class="macro-syntax"> |
21 |
|
|
getdate <strvar> [<format>] |
22 |
|
|
</pre> |
23 |
|
|
|
24 |
|
|
<h2>Remarks</h2> |
25 |
|
|
|
26 |
|
|
<p> |
27 |
|
|
Returns the current date in the string variable <strvar>, with the default format "YYYY-MM-DD". |
28 |
|
|
The user can specify the format same as <a href="http://msdn2.microsoft.com/en-us/library/fe06s4ak(VS.80).aspx">strftime</a>. And also, the default format equals "%Y-%m-%d" at the <format> argument. |
29 |
|
|
</p> |
30 |
|
|
|
31 |
|
|
<p> |
32 |
|
|
The behavior of the getdate command specified with the format equals the gettime command specified with the same format. |
33 |
|
|
</p> |
34 |
|
|
|
35 |
|
|
<p> |
36 |
|
|
This command returns one of the following values in the system variable "result": |
37 |
|
|
</p> |
38 |
|
|
|
39 |
|
|
<table> |
40 |
|
|
<thead> |
41 |
|
|
<tr> |
42 |
|
|
<th>Value</th> |
43 |
|
|
<th>Meaning</th> |
44 |
|
|
</tr> |
45 |
|
|
</thead> |
46 |
|
|
|
47 |
|
|
<tbody> |
48 |
|
|
<tr> |
49 |
|
|
<td>0</td> |
50 |
|
|
<td> |
51 |
|
|
Normal success. <strvar> is stored. |
52 |
|
|
</td> |
53 |
|
|
</tr> |
54 |
|
|
|
55 |
|
|
<tr> |
56 |
|
|
<td>1</td> |
57 |
|
|
<td> |
58 |
|
|
Error. <strvar> is not stored because a length of the generated string exceeds the upper limit -255 characters-. |
59 |
|
|
</td> |
60 |
|
|
</tr> |
61 |
|
|
|
62 |
|
|
<tr> |
63 |
|
|
<td>2</td> |
64 |
|
|
<td> |
65 |
|
|
Error. <format> is invalid. |
66 |
|
|
</td> |
67 |
|
|
</tr> |
68 |
|
|
</tbody> |
69 |
|
|
</table> |
70 |
|
|
|
71 |
|
|
<h2>Example</h2> |
72 |
|
|
|
73 |
|
|
<pre class="macro-example"> |
74 |
|
|
;Stores the current date to "datestr" variable with YYYY-MM-DD format. |
75 |
|
|
getdate datestr |
76 |
|
|
|
77 |
|
|
;Stores the current date with the user format to "logfile" variable. |
78 |
|
|
;The format is log-YYYYMMDD-HHMMSS.txt. |
79 |
|
|
getdate logfile "log-%Y%m%d-%H%M%S.txt" |
80 |
|
|
</pre> |
81 |
|
|
|
82 |
|
|
<h2>See also</h2> |
83 |
|
|
<ul> |
84 |
|
|
<li><a href="gettime.html">gettime</a></li> |
85 |
|
|
<li><a href="http://msdn2.microsoft.com/en-us/library/fe06s4ak(VS.80).aspx">strftime (MSDN Library)</a></li> |
86 |
|
|
</ul> |
87 |
|
|
|
88 |
|
|
</body> |
89 |
|
|
</html> |
|