Develop and Download Open Source Software

Browse Subversion Repository

Contents of /trunk/doc/en/html/macro/command/gettime.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10870 - (show annotations) (download) (as text)
Wed Aug 23 14:17:40 2023 UTC (9 months ago) by nmaya
File MIME type: text/html
File size: 2557 byte(s)
外部へのリンクに target="_blank" を指定

chm を表示している hh.exe 外(標準のブラウザ?)で開くリンクになる
ticket #44049
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=iso-8859-1">
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 Gets current time.
18 </p>
19
20 <pre class="macro-syntax">
21 gettime &lt;strvar&gt; [&lt;format&gt; [&lt;timezone&gt;]]
22 </pre>
23
24 <h2>Remarks</h2>
25
26 <p>
27 Returns the current time in the string variable &lt;strvar&gt;, with the default format "HH:MM:SS".
28 The user can specify the format same as <a href="http://msdn2.microsoft.com/en-us/library/fe06s4ak(VS.80).aspx" target="_blank">strftime</a>. And also, the default format equals "%H:%M:%S" at the &lt;format&gt; argument.
29 </p>
30
31 <p>
32 The behavior of the gettime command specified with the format equals the getdate command specified with the same format.<br>
33 When the &lt;timezone&gt; argument is specified as a timezone string, the timestamp is generated by using the timezone.
34 When the &lt;timezone&gt; argument is not specified, the timestamp is treated as the localtime.
35 </p>
36
37 <p>
38 This command returns one of the following values in the system variable "result":
39 </p>
40
41 <table>
42 <thead>
43 <tr>
44 <th>Value</th>
45 <th>Meaning</th>
46 </tr>
47 </thead>
48
49 <tbody>
50 <tr>
51 <td>0</td>
52 <td>
53 Normal success. &lt;strvar&gt; is stored.
54 </td>
55 </tr>
56
57 <tr>
58 <td>1</td>
59 <td>
60 Error. &lt;strvar&gt; is not stored because a length of the generated string exceeds the upper limit -511 characters-.
61 </td>
62 </tr>
63
64 <tr>
65 <td>2</td>
66 <td>
67 Error. &lt;format&gt; is invalid.
68 </td>
69 </tr>
70 </tbody>
71 </table>
72
73 <h2>Example</h2>
74
75 <pre class="macro-example">
76 ;Stores the current time to "timestr" variable with HH:MM:SS format.
77 gettime timestr
78
79 ;Stores the current date with the user format to "logfile" variable.
80 ;The format is log-YYYYMMDD-HHMMSS.txt.
81 gettime logfile "log-%Y%m%d-%H%M%S.txt"
82 changedir 'C:\Test'
83 logopen logfile 0 0
84 logwrite 'test data'
85 logclose
86
87 ;To generate a GMT/UTC time stamp
88 tz="GMT"
89 gettime s "%Y/%m/%d %H:%M:%S" tz
90 messagebox s tz
91 </pre>
92
93 <h2>See also</h2>
94 <ul>
95 <li><a href="getdate.html">getdate</a></li>
96 <li><a href="http://msdn2.microsoft.com/en-us/library/fe06s4ak(VS.80).aspx" target="_blank">strftime (MSDN Library)</a></li>
97 </ul>
98
99 </body>
100 </html>

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26