$Sir Date2NM: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Automatically generated page update)
(Automatically generated page update)
Line 51: Line 51:
<li>[[Janus Web Server]]</li>
<li>[[Janus Web Server]]</li>
<li>Japanese functions</li>
<li>Japanese functions</li>
<li>[http://m204wiki.rocketsoftware.com/images/4/4b/SirfieldNew.pdf Sir2000 Field Migration Facility]</li>
<li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]</li>
<li>[http://m204wiki.rocketsoftware.com/images/d/d6/Ul2krNew.pdf Sir2000 User Language Tools]</li>
<li>[http://m204wiki.rocketsoftware.com/images/d/d6/Ul2krNew.pdf Sir2000 User Language Tools]</li>
</ul>
</ul>


[[Category:$Functions|$Sir_Date2NM]]
[[Category:$Functions|$Sir_Date2NM]]

Revision as of 22:58, 19 February 2015

Convert datetime string to number of milliseconds

Note: Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Sir_Date2NM function is StringToMilliseconds.

The $Sir_Date2NM function expects a datetime value string and a datetime format string and returns the input datetime converted to the number of milliseconds since 1 January, 1900. It accepts an optional CENTSPAN value and an optional error control string. If an error is detected, the returned value is -9E12 (-9000000000000).

Syntax

%num = $Sir_Date2NM(dat, fmt, span, errctl)

Syntax terms

%num Set to the value of dat, converted to the number of milliseconds from 1 Jan 1900 12:00 AM.
dat Datetime value string.
fmt Datetime format string corresponding to dat. Refer to datetime formats for an explanation of valid datetime formats and valid dates. Non-strict matching is used for input format fmt; see "Strict and non-strict format matching".
span Optional CENTSPAN value, default is -50.
errctl Optional error control string; refer to "Datetime error handling".

Usage notes

  • Values returned by $Sir_Date2NM will often exceed the range that can be represented in a 4-byte integer, so you should probably avoid storing the value in a BINARY or FLOAT4 field.
  • Dates prior to 1 January 1900 will return a negative number.
  • The inverse of this $function is $Sir_NM2Date.
  • $Sir_Date2NM returns the value -9E12 (-9000000000000) in the following cases (see the discussion in "Datetime error handling"):
    • fmt is not a valid datetime format.
    • dat does not match fmt.
    • dat is outside of range permitted for fmt.
    • span is invalid.

Products authorizing $Sir_Date2NM