$Sir Date: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:$Sir_Date}} | {{DISPLAYTITLE:$Sir_Date}} | ||
<span class="pageSubtitle" | <span class="pageSubtitle">Get current datetime</span> | ||
<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent of <var>$Sir_Date</var> is <var>[[CurrentTimeString (System function)|CurrentTimeString]]</var>.</p> | <p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent of <var>$Sir_Date</var> is <var>[[CurrentTimeString (System function)|CurrentTimeString]]</var>.</p> |
Revision as of 21:21, 22 November 2011
Get current datetime
Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent of $Sir_Date is CurrentTimeString.
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.