use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\System;
+use Friendica\Util\DateTimeFormat;
use Friendica\Util\Temporal;
-require_once 'include/datetime.php';
-
function localtime_post(App $a)
{
$t = $_REQUEST['time'];
$bd_format = L10n::t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8 AM
if ($_POST['timezone']) {
- $a->data['mod-localtime'] = Temporal::convert($t, $_POST['timezone'], 'UTC', $bd_format);
+ $a->data['mod-localtime'] = DateTimeFormat::convert($t, $_POST['timezone'], 'UTC', $bd_format);
}
}
$t = 'now';
}
- $o .= '<h3>' . L10n::t('Time Conversion') . '</h3>';
+ $o = '<h3>' . L10n::t('Time Conversion') . '</h3>';
$o .= '<p>' . L10n::t('Friendica provides this service for sharing events with other networks and friends in unknown timezones.') . '</p>';
$o .= '<p>' . L10n::t('Current timezone: %s', $_REQUEST['timezone']) . '</p>';
}
- if (x($a->data, 'mod-localtime')) {
+ if (!empty($a->data['mod-localtime'])) {
$o .= '<p>' . L10n::t('Converted localtime: %s', $a->data['mod-localtime']) . '</p>';
}