$Sir DateFmt: Difference between revisions
Jump to navigation
Jump to search
m (→Syntax) |
mNo edit summary |
||
Line 4: | Line 4: | ||
<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is currently no OO equivalent for the $Sir_DateFmt function.</p> | <p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is currently no OO equivalent for the $Sir_DateFmt function.</p> | ||
The $Sir_DateFmt function expects a datetime format string and returns the value 1 if the datetime format is valid, else the value 0. | The <var>$Sir_DateFmt</var> function expects a datetime format string and returns the value 1 if the datetime format is valid, else the value 0. | ||
==Syntax== | ==Syntax== | ||
Line 14: | Line 14: | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>fmt</th> | <tr><th>fmt</th> | ||
<td> | <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> | <td>Set to 1 if <var class="term">fmt</var> is a valid datetime format string, otherwise set to 0. | ||
</td></tr> | </td></tr> | ||
</table> | </table> | ||
==Usage notes== | |||
<ul> | |||
<li>This $function has no error conditions. | |||
</ul> | |||
==Example== | ==Example== | ||
The following fragment prints the string < | The following fragment prints the string <code>Good</code>: | ||
<p class="code"> % | <p class="code">%x = $Sir_DateFmt('CYYDDDHHMISSXXX') | ||
If %x = 1 Then | |||
Print 'Good' | |||
Else | |||
Print 'Bad' | |||
End If | |||
</p> | </p> | ||
<ul class="smallAndTightList"> | <ul class="smallAndTightList"> |
Revision as of 22:33, 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. |
Usage notes
- This $function has no error conditions.
Example
The following fragment prints the string Good
:
%x = $Sir_DateFmt('CYYDDDHHMISSXXX') If %x = 1 Then Print 'Good' Else Print 'Bad' End If