$Sir Date: Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
mNo edit summary |
||
Line 2: | Line 2: | ||
<span class="pageSubtitle"><section begin="desc" />Get current datetime<section end="desc" /></span> | <span class="pageSubtitle"><section begin="desc" />Get current datetime<section end="desc" /></span> | ||
<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. | <p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is currently no OO equivalent for the $Sir_Date function.</p> | ||
This function accepts an optional datetime format string and an optional error control string, and returns the current date and time as a character string with the specified format. | |||
==Syntax== | ==Syntax== | ||
<p class="syntax"><section begin="syntax" /> %odate = $Sir_Date(fmt, errctl) | <p class="syntax"><section begin="syntax" /> %odate = $Sir_Date(fmt, errctl) | ||
Line 12: | Line 11: | ||
<p class="caption">$Sir_Date Function | <p class="caption">$Sir_Date Function | ||
</p> | </p> | ||
where | where | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>fmt</th> | <tr><th>fmt</th> | ||
Line 20: | Line 21: | ||
<tr><th>%odate</th> | <tr><th>%odate</th> | ||
<td>set to contain the current date and time, in the format specified by '''fmt'''. | <td>set to contain the current date and time, in the format specified by '''fmt'''. | ||
</td></tr></table> | </td></tr> | ||
</table> | |||
For example, the following fragment prints a value such as <tt>.Monday, 1 January 2001 AT 01:11:10 PM</tt>. | |||
<p class="code"> PRINT $Sir_Date('Wkday, DAY Month YYYY' WITH - | <p class="code"> PRINT $Sir_Date('Wkday, DAY Month YYYY' WITH - | ||
' "A"T HH:MI:SS AM') | ' "A"T HH:MI:SS AM') | ||
</p> | </p> | ||
Error conditions are shown in the following figure (see the discussion in ). | |||
Error conditions are shown in the following figure (see the discussion in ). | |||
<ul> | <ul> | ||
<li><i>fmt</i> is not a valid datetime format. | <li><i>fmt</i> is not a valid datetime format. | ||
</ul> | </ul> | ||
<p class="caption"> $Sir_Date returns the null string in the following error cases:</p> | <p class="caption"> $Sir_Date returns the null string in the following error cases:</p> | ||
Line 55: | Line 51: | ||
<p class="caption">Products authorizing $Sir_Date | <p class="caption">Products authorizing $Sir_Date | ||
</p> | </p> | ||
[[Category:$Functions|$Sir_Date]] | [[Category:$Functions|$Sir_Date]] |
Revision as of 19:03, 8 February 2011
<section begin="desc" />Get current datetime<section end="desc" />
Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is currently no OO equivalent for the $Sir_Date function.
This function accepts an optional datetime format string and an optional error control string, and returns the current date and time as a character string with the specified format.
Syntax
<section begin="syntax" /> %odate = $Sir_Date(fmt, errctl) <section end="syntax" />
where
fmt | optional datetime format string, defaults to 'YY-MM-DD'. Refer to for an explanation of valid datetime formats and valid datetime values. |
---|---|
errctl | optional error control string, refer to . |
%odate | set to contain the current date and time, in the format specified by fmt. |
For example, the following fragment prints a value such as .Monday, 1 January 2001 AT 01:11:10 PM.
PRINT $Sir_Date('Wkday, DAY Month YYYY' WITH - ' "A"T HH:MI:SS AM')
Error conditions are shown in the following figure (see the discussion in ).
- fmt is not a valid datetime format.