PageRenderTime 40ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/hphp/test/zend/bad/ext/date/tests/date-lenient-create.php

http://github.com/facebook/hiphop-php
PHP | 26 lines | 24 code | 2 blank | 0 comment | 0 complexity | b48d5a8e4a4593a7cff14b62ef840e34 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
  1. <?php
  2. $tz = new DateTimeZone("UTC");
  3. $date = "06/08/04 12:00";
  4. echo "==\n";
  5. print_r( date_create_from_format( 'm/d/y', $date , $tz) );
  6. print_r( date_get_last_errors() );
  7. echo "==\n";
  8. print_r( date_create_from_format( 'm/d/y+', $date , $tz)->setTime(0, 0) );
  9. print_r( date_get_last_errors() );
  10. echo "==\n";
  11. print_r( date_create_from_format( '+m/d/y', $date , $tz)->setTime(0, 0) );
  12. print_r( date_get_last_errors() );
  13. echo "==\n";
  14. print_r( date_create_from_format( 'm/d/y++', $date , $tz)->setTime(0, 0) );
  15. print_r( date_get_last_errors() );
  16. echo "==\n";
  17. $date = "06/08/04";
  18. print_r( date_create_from_format( 'm/d/y+', $date , $tz)->setTime(0, 0) );
  19. print_r( date_get_last_errors() );
  20. echo "==\n";
  21. print_r( date_create_from_format( '+m/d/y', $date , $tz)->setTime(0, 0) );
  22. print_r( date_get_last_errors() );
  23. echo "==\n";
  24. ?>