- date: documentation ( source)
- strtotime: documentation ( source)
<?php
function format(string $s)
{
print $s . ' is interprted as ' . date('r', strtotime($s)) . PHP_EOL;
}
format('5/6/22');
format('5.6.22');
format('5-6-22');
format('5/6/2022');
format('5.6.2022');
format('5-6-2022');