date.inc 360 B

1234567891011121314151617181920
  1. <?php
  2. class DateFormatter {
  3. const DEFAULT_FORMAT = 'l Y-m-d';
  4. public $format;
  5. public $time;
  6. public function __construct() {
  7. if (!empty($_REQUEST['apply'])) {
  8. $this->format = $_REQUEST['format'];
  9. }
  10. else {
  11. $this->format = self::DEFAULT_FORMAT;
  12. }
  13. }
  14. public function date() {
  15. return date($this->format, time());
  16. }
  17. }