3 * @file mod/localtime.php
6 use Friendica\Core\L10n;
7 use Friendica\Core\System;
9 require_once 'include/datetime.php';
11 function localtime_post(App $a)
13 $t = $_REQUEST['time'];
18 $bd_format = L10n::t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8 AM
20 if ($_POST['timezone']) {
21 $a->data['mod-localtime'] = datetime_convert('UTC', $_POST['timezone'], $t, $bd_format);
25 function localtime_content(App $a)
27 $t = $_REQUEST['time'];
32 $o .= '<h3>' . L10n::t('Time Conversion') . '</h3>';
34 $o .= '<p>' . L10n::t('Friendica provides this service for sharing events with other networks and friends in unknown timezones.') . '</p>';
38 $o .= '<p>' . sprintf(L10n::t('UTC time: %s'), $t) . '</p>';
40 if ($_REQUEST['timezone']) {
41 $o .= '<p>' . sprintf(L10n::t('Current timezone: %s'), $_REQUEST['timezone']) . '</p>';
44 if (x($a->data, 'mod-localtime')) {
45 $o .= '<p>' . sprintf(L10n::t('Converted localtime: %s'), $a->data['mod-localtime']) . '</p>';
49 $o .= '<form action ="' . System::baseUrl() . '/localtime?f=&time=' . $t . '" method="post" >';
51 $o .= '<p>' . L10n::t('Please select your timezone:') . '</p>';
53 $o .= select_timezone(($_REQUEST['timezone']) ? $_REQUEST['timezone'] : 'America/Los_Angeles');
55 $o .= '<input type="submit" name="submit" value="' . L10n::t('Submit') . '" /></form>';