$Sir DateNS: Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
m (link repair) |
||
(40 intermediate revisions by 4 users not shown) | |||
Line 2: | Line 2: | ||
<span class="pageSubtitle">Current date and time as number of seconds</span> | <span class="pageSubtitle">Current date and time as number of seconds</span> | ||
<p class=" | <p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent of $Sir_DateNS is <var>[[CurrentTimeSeconds (System function)|CurrentTimeSeconds]]</var>.</p> | ||
The $Sir_DateNS function has no arguments and returns the number of seconds since 1 January, 1900. | The <var>$Sir_DateNS</var> function has no arguments and returns the number of seconds since 1 January, 1900. | ||
==Syntax== | ==Syntax== | ||
<p class="syntax">< | <p class="syntax"><span class="term">%num</span> = $Sir_DateNS | ||
</p> | </p> | ||
===Syntax terms=== | |||
<table> | |||
<table | |||
<tr><th>%num</th> | <tr><th>%num</th> | ||
<td> | <td>Set to the number of seconds from <code>1 Jan 1900 12:00 AM</code> to the current date and time. | ||
</td></tr> | </td></tr> | ||
</table> | </table> | ||
==Usage notes== | |||
< | <ul> | ||
</ | <li><var>$Sir_DateNS</var> has no error conditions.</li> | ||
<li>Values returned by <var>$Sir_DateNS</var> will exceed the range that can be represented in a 4-byte integer, so you should probably avoid storing the value in a <code>BINARY</code> or <code>FLOAT4</code> field. </li> | |||
$ | <li>To obtain the current date and time in a readable form, use <var>$Sir_Date</var>. </li> | ||
<li>To convert the number of seconds to a readable form, use <var>[[$Sir_NS2Date]]</var>.</li> | |||
<li>To convert the number of seconds to a readable form, use $Sir_NS2Date. | |||
</ul> | </ul> | ||
==Example== | |||
The following fragment will print the date and time 1 minute from the current time: | |||
<p class="code">Print $Sir_NS2Date($Sir_DateNS + 60, 'MM/DD/YY HH:MI:SS') | |||
</p> | |||
==Products authorizing {{PAGENAMEE}}== | |||
<ul class="smallAndTightList"> | <ul class="smallAndTightList"> | ||
<li>[[Sirius functions]]</li> | <li>[[List of $functions|Sirius functions]]</li> | ||
<li>[[Fast/Unload User Language Interface]]</li> | <li>[[Fast/Unload User Language Interface]]</li> | ||
<li>[[Janus Open Client]]</li> | <li>[[Media:JoclrNew.pdf|Janus Open Client]]</li> | ||
<li>[[Janus Open Server]]</li> | <li>[[Media:JosrvrNew.pdf|Janus Open Server]]</li> | ||
<li>[[Janus Sockets]]</li> | <li>[[Janus Sockets]]</li> | ||
<li>[[Janus Web Server]]</li> | <li>[[Janus Web Server]]</li> | ||
<li> | <li>Japanese functions</li> | ||
<li>[[Sir2000 Field Migration Facility]]</li> | <li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li> | ||
<li>[[Sir2000 User Language Tools]]</li> | <li>[[Sir2000 User Language Tools]]</li> | ||
</ul> | </ul> | ||
[[Category:$Functions|$Sir_DateNS]] | [[Category:$Functions|$Sir_DateNS]] |
Latest revision as of 22:51, 8 February 2018
Current date and time as number of seconds
Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent of $Sir_DateNS is CurrentTimeSeconds.
The $Sir_DateNS function has no arguments and returns the number of seconds since 1 January, 1900.
Syntax
%num = $Sir_DateNS
Syntax terms
%num | Set to the number of seconds from 1 Jan 1900 12:00 AM to the current date and time.
|
---|
Usage notes
- $Sir_DateNS has no error conditions.
- Values returned by $Sir_DateNS will exceed the range that can be represented in a 4-byte integer, so you should probably avoid storing the value in a
BINARY
orFLOAT4
field. - To obtain the current date and time in a readable form, use $Sir_Date.
- To convert the number of seconds to a readable form, use $Sir_NS2Date.
Example
The following fragment will print the date and time 1 minute from the current time:
Print $Sir_NS2Date($Sir_DateNS + 60, 'MM/DD/YY HH:MI:SS')