Guest User

Untitled

a guest
Aug 17th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. <?php
  2.  
  3. $dates = [
  4. DateTime::createFromFormat('Y-m-d', '2000-02-01'),
  5. DateTime::createFromFormat('Y-m-d', '1994-01-30'),
  6. DateTime::createFromFormat('Y-m-d H:i:s', '2018-07-27 12:03:33'),
  7. DateTime::createFromFormat('Y-m-d', '2006-07-27'),
  8. DateTime::createFromFormat('Y-m-d H:i:s', '2018-07-27 12:04:15'),
  9. ];
  10.  
  11. usort($dates, function ($a, $b) {
  12. return $a <=> $b;
  13. });
Add Comment
Please, Sign In to add comment