3 ms·
Stick with php -a, or here's a bash script that does the same thing: #!/usr/bin/php <?php $input = implode(' ', array_slice($argv, 1)); $timestamp = st
by smokestack 16y ago
Stick with php -a, or here's a bash script that does the same thing:
#!/usr/bin/php
<?php
$input = implode(' ', array_slice($argv, 1));
$timestamp = strtotime($input);
echo "Raw: $input\n";
echo "Interpreted: " . date('r', $timestamp) . " ($timestamp)\n";
Usage:
./test_strtotime Mar 5
./test_strtotime "Mar 5" 2009