$Sir Date: Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
m (1 revision) |
||
Line 2: | Line 2: | ||
<span class="pageSubtitle">Get current datetime</span> | <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 $Sir_Date 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> | ||
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. | 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. |
Revision as of 01:28, 19 October 2012
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" />
Syntax terms
%odate | Set to contain the current date and time, in the format specified by fmt. |
---|---|
fmt | Optional datetime format string, defaults to 'YY-MM-DD'. Refer to "Datetime string formats" for an explanation of valid datetime formats and valid datetime values. |
errctl | Optional error control string; refer to "Datetime error handling". |
Usage notes
- $Sir_Date returns the null string in the following error case: fmt is not a valid datetime format. For more information about error handling, see "Datetime error handling").
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')