Date.php 675 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. *
  4. * PHP Pro Bid $Id$ X2zk0Pl/yxRFz/jtj6HhV2E5k2oNy4gFDuI9GTrrCLM=
  5. *
  6. * @link http://www.phpprobid.com
  7. * @copyright Copyright (c) 2017 Online Ventures Software & CodeCube SRL
  8. * @license http://www.phpprobid.com/license Commercial License
  9. *
  10. * @version 7.10 [rev.7.10.01]
  11. */
  12. /**
  13. * this class converts a date string into a mysql datetime format
  14. *
  15. */
  16. namespace Ppb\Db\Expr;
  17. use Cube\Db\Expr;
  18. class Date extends Expr
  19. {
  20. /**
  21. *
  22. * magic method
  23. * return the expression
  24. *
  25. * @return string
  26. */
  27. public function __toString()
  28. {
  29. return "'" . date("Y-m-d", strtotime($this->_expression)) . "'";
  30. }
  31. }