Date.php 285 B

12345678910111213141516171819
  1. <?php
  2. namespace App\Utils;
  3. use DateTimeImmutable;
  4. class Date
  5. {
  6. /*
  7. * Humaniza un fecha.
  8. */
  9. public static function humanize(?string $datetime = 'now')
  10. {
  11. $date = new DateTimeImmutable($datetime);
  12. return $date->format('D, d M Y h:i:s A');
  13. }
  14. }