IsValidDate.xml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
  4. <sect1 id="IsValidDate">
  5. <title>IsValidDate</title>
  6. <para><emphasis role="bold">STD.Date.IsValidDate<indexterm>
  7. <primary>STD.Date.IsValidDate</primary>
  8. </indexterm><indexterm>
  9. <primary>Date.IsValidDate</primary>
  10. </indexterm><indexterm>
  11. <primary>IsValidDate</primary>
  12. </indexterm>(</emphasis> <emphasis>date</emphasis> ,
  13. [<emphasis>yearLowerBound</emphasis>],[<emphasis>yearUpperBound</emphasis>]
  14. <emphasis role="bold">)</emphasis></para>
  15. <informaltable colsep="1" frame="all" rowsep="1">
  16. <tgroup cols="2">
  17. <colspec colwidth="80.50pt" />
  18. <colspec />
  19. <tbody>
  20. <row>
  21. <entry><emphasis>date</emphasis></entry>
  22. <entry>A date value in the Date_t format.</entry>
  23. </row>
  24. <row>
  25. <entry><emphasis>yearLowerBound</emphasis></entry>
  26. <entry>The minimum acceptable year. Optional; defaults to
  27. 1800.</entry>
  28. </row>
  29. <row>
  30. <entry><emphasis><emphasis>yearUpperBound</emphasis></emphasis></entry>
  31. <entry>The maximum acceptable year. Optional; defaults to
  32. 2100.</entry>
  33. </row>
  34. <row>
  35. <entry>Return:</entry>
  36. <entry>IsValidDateYear returns a BOOLEAN value.</entry>
  37. </row>
  38. </tbody>
  39. </tgroup>
  40. </informaltable>
  41. <para>The <emphasis role="bold">IsValidDate</emphasis> function returns TRUE
  42. if the date is valid, both by range-checking the year and by validating each
  43. of the other individual components.</para>
  44. <para>Example:</para>
  45. <programlisting format="linespecific">IMPORT STD;
  46. d1 := 19631122;
  47. d2 := 19990230;
  48. firstTest := STD.Date.IsValidDate(d1); //d1 is valid
  49. secondTest := STD.Date.IsValidDate(d2); //d2 is not valid
  50. </programlisting>
  51. <para></para>
  52. </sect1>