Source for file ChronologyConstants.class.php

Documentation is available at ChronologyConstants.class.php

  1. <?php
  2. /**
  3. * @since 5/2/05
  4. * @package harmoni.primitives.chronology
  5. *
  6. * @copyright Copyright &copy; 2005, Middlebury College
  7. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  8. *
  9. * @version $Id: ChronologyConstants.class.php,v 1.2 2006/06/26 12:55:07 adamfranco Exp $
  10. *
  11. * @link http://harmoni.sourceforge.net/
  12. * @author Adam Franco <adam AT adamfranco DOT com> <afranco AT middlebury DOT edu>
  13. */
  14.  
  15. /**
  16. * ChronologyConstants is a SharedPool for the constants used by the
  17. * Kernel-Chronology classes.
  18. *
  19. *
  20. * @since 5/2/05
  21. * @package harmoni.primitives.chronology
  22. *
  23. * @copyright Copyright &copy; 2005, Middlebury College
  24. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  25. *
  26. * @version $Id: ChronologyConstants.class.php,v 1.2 2006/06/26 12:55:07 adamfranco Exp $
  27. *
  28. * @link http://harmoni.sourceforge.net/
  29. * @author Adam Franco <adam AT adamfranco DOT com> <afranco AT middlebury DOT edu>
  30. * @static
  31. */
  32. class ChronologyConstants {
  33. /**
  34. * Julian day number of 1 Jan 1901
  35. *
  36. * @return integer
  37. * @access public
  38. * @since 5/2/05
  39. * @static
  40. */
  41. function SqueakEpoch () {
  42. return 2415386;
  43. }
  44. /**
  45. * Number of seconds in a day
  46. *
  47. * @return integer
  48. * @access public
  49. * @since 5/2/05
  50. * @static
  51. */
  52. function SecondsInDay () {
  53. return 86400;
  54. }
  55. /**
  56. * Number of seconds in an hour
  57. *
  58. * @return integer
  59. * @access public
  60. * @since 5/2/05
  61. * @static
  62. */
  63. function SecondsInHour () {
  64. return 3600;
  65. }
  66. /**
  67. * Number of seconds in a minute
  68. *
  69. * @return integer
  70. * @access public
  71. * @since 5/2/05
  72. * @static
  73. */
  74. function SecondsInMinute () {
  75. return 60;
  76. }
  77. /**
  78. * Nanoseconds in a second
  79. *
  80. * @return integer
  81. * @access public
  82. * @since 5/2/05
  83. * @static
  84. */
  85. function NanosInSecond () {
  86. return pow (10, 9);
  87. }
  88. /**
  89. * Nanoseconds in a millisecond
  90. *
  91. * @return integer
  92. * @access public
  93. * @since 5/2/05
  94. * @static
  95. */
  96. function NanosInMillisecond () {
  97. return pow (10, 6);
  98. }
  99. /**
  100. * Names of days of the week.
  101. *
  102. * @return array
  103. * @access public
  104. * @since 5/2/05
  105. * @static
  106. */
  107. function DayNames () {
  108. return array (1 => 'Sunday', 2 => 'Monday', 3 => 'Tuesday', 4 => 'Wednesday',
  109. 5 => 'Thursday', 6 => 'Friday', 7 => 'Saturday');
  110. }
  111. /**
  112. * Names of months.
  113. *
  114. * @return array
  115. * @access public
  116. * @since 5/2/05
  117. * @static
  118. */
  119. function MonthNames () {
  120. return array (1 => 'January', 2 => 'February', 3 => 'March', 4 => 'April',
  121. 5 => 'May', 6 => 'June', 7 => 'July', 8 => 'August', 9 => 'September',
  122. 10 => 'October', 11 => 'November', 12 => 'December');
  123. }
  124. /**
  125. * Names number of days in each month.
  126. *
  127. * @return array
  128. * @access public
  129. * @since 5/2/05
  130. * @static
  131. */
  132. function DaysInMonth () {
  133. return array (1 => 31, 2 => 28, 3 => 31, 4 => 30, 5 => 31, 6 => 30,
  134. 7 => 31, 8 => 31, 9 => 30, 10 => 31, 11 => 30, 12 => 31);
  135. }
  136. }
  137.  
  138. ?>

Documentation generated on Wed, 19 Sep 2007 10:22:03 -0400 by phpDocumentor 1.3.0RC3