PageRenderTime 59ms CodeModel.GetById 11ms RepoModel.GetById 1ms app.codeStats 0ms

/module/Rubedo/src/Rubedo/Interfaces/Time/IDate.php

https://github.com/hgregoire/rubedo
PHP | 103 lines | 12 code | 8 blank | 83 comment | 0 complexity | 2377815fa67f285668c3a024860d181e MD5 | raw file
  1. <?php
  2. /**
  3. * Rubedo -- ECM solution
  4. * Copyright (c) 2013, WebTales (http://www.webtales.fr/).
  5. * All rights reserved.
  6. * licensing@webtales.fr
  7. *
  8. * Open Source License
  9. * ------------------------------------------------------------------------------------------
  10. * Rubedo is licensed under the terms of the Open Source GPL 3.0 license.
  11. *
  12. * @category Rubedo
  13. * @package Rubedo
  14. * @copyright Copyright (c) 2012-2013 WebTales (http://www.webtales.fr)
  15. * @license http://www.gnu.org/licenses/gpl.html Open Source GPL 3.0 license
  16. */
  17. namespace Rubedo\Interfaces\Time;
  18. /**
  19. * Date Service
  20. *
  21. *
  22. *
  23. * @author jbourdin
  24. * @category Rubedo
  25. * @package Rubedo
  26. */
  27. interface IDate
  28. {
  29. /**
  30. * Convert a date string to a timestamp
  31. *
  32. * @see http://www.php.net/manual/datetime.formats.php
  33. * @param
  34. * $dateString
  35. * @return string timestamp format datetime (number of second since unix
  36. * dawn of time)
  37. */
  38. public function convertToTimeStamp($dateString);
  39. /**
  40. * Format to Y-m-d date string or timestamp
  41. *
  42. * @param string $dateString
  43. * @return String formatted date
  44. */
  45. public function convertToYmd($dateString);
  46. /**
  47. * Format to H:i:s date string or timestamp
  48. *
  49. * @param string $dateString
  50. * @return String formatted date
  51. */
  52. public function convertToHis($dateString);
  53. /**
  54. * Return an array of a month (current or including given timestamp)
  55. *
  56. * This array contains the complete weeks containing at least on day of the
  57. * month
  58. * each week is an array containing the ordinal of the seven days.
  59. *
  60. * i.e. mars 2013
  61. *
  62. * 25 26 27 28 01 02 03
  63. * 04 05 06 07 08 09 10
  64. * 11 12 13 14 15 16 17
  65. * 18 19 20 21 22 23 24
  66. * 25 26 27 28 29 30 31
  67. *
  68. *
  69. * @param string $timestamp
  70. * @return array
  71. */
  72. public function getMonthArray($timestamp = null);
  73. /**
  74. * Return the localized list of the days of the week.
  75. * (short name)
  76. *
  77. * @return array
  78. */
  79. public function getShortDayList();
  80. /**
  81. * get a localized date with format and timestamp arguments
  82. *
  83. * @param string $format
  84. * @param string $timestamp
  85. * @return string
  86. */
  87. public function getLocalised($format = null, $timestamp = null);
  88. /**
  89. * Get a date time in local format
  90. *
  91. * @param string $timestamp
  92. * @return string
  93. */
  94. public function getDefaultDatetime($timestamp = null);
  95. }