web-utils/modules/date/date.php

11 lines
174 B
PHP
Raw Permalink Normal View History

2021-08-08 17:23:49 +00:00
<?php
$format = $_GET['format'] ?? 'full';
date_default_timezone_set($_GET['timezone'] ?? 'UTC');
echo date(match ($format) {
'full' => 'Y-m-d H:i:s',
'unix' => 'U'
});