$Sir DateFmt: Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
m (→Syntax) |
||
Line 9: | Line 9: | ||
<p class="syntax"><section begin="syntax" /> %tst = $Sir_DateFmt(fmt) | <p class="syntax"><section begin="syntax" /> %tst = $Sir_DateFmt(fmt) | ||
<section end="syntax" /></p> | <section end="syntax" /></p> | ||
===Syntax terms=== | |||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>fmt</th> | <tr><th>fmt</th> | ||
<td>datetime format string. Refer to for an explanation of valid datetime format strings.</td></tr> | <td>datetime format string. Refer to [[Datetime string formats|"Datetime string formats"]] for an explanation of valid datetime format strings.</td></tr> | ||
<tr><th>%tst</th> | <tr><th>%tst</th> | ||
<td>set to 1 if '''fmt''' is a valid datetime format string, otherwise set to 0. | <td>set to 1 if '''fmt''' is a valid datetime format string, otherwise set to 0. | ||
Line 22: | Line 20: | ||
</table> | </table> | ||
==Example== | |||
The following fragment prints the string <tt>Good</tt>: | |||
<p class="code"> %X = $Sir_DateFmt('CYYDDDHHMISSXXX') | <p class="code"> %X = $Sir_DateFmt('CYYDDDHHMISSXXX') |
Revision as of 20:56, 8 February 2012
Validate datetime format
Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is currently no OO equivalent for the $Sir_DateFmt function.
The $Sir_DateFmt function expects a datetime format string and returns the value 1 if the datetime format is valid, else the value 0.
Syntax
<section begin="syntax" /> %tst = $Sir_DateFmt(fmt) <section end="syntax" />
Syntax terms
fmt | datetime format string. Refer to "Datetime string formats" for an explanation of valid datetime format strings. |
---|---|
%tst | set to 1 if fmt is a valid datetime format string, otherwise set to 0. |
Example
The following fragment prints the string Good:
%X = $Sir_DateFmt('CYYDDDHHMISSXXX') IF %X = 1 THEN PRINT 'Good' ELSE PRINT 'Bad' END IF
This $function has no error conditions.