4 use Friendica\Core\System;
6 require_once('include/datetime.php');
8 function localtime_post(App $a) {
10 $t = $_REQUEST['time'];
14 $bd_format = t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8 AM
16 if($_POST['timezone'])
17 $a->data['mod-localtime'] = datetime_convert('UTC',$_POST['timezone'],$t,$bd_format);
21 function localtime_content(App $a) {
22 $t = $_REQUEST['time'];
26 $o .= '<h3>' . t('Time Conversion') . '</h3>';
28 $o .= '<p>' . t('Friendica provides this service for sharing events with other networks and friends in unknown timezones.') . '</p>';
32 $o .= '<p>' . sprintf( t('UTC time: %s'), $t) . '</p>';
34 if($_REQUEST['timezone'])
35 $o .= '<p>' . sprintf( t('Current timezone: %s'), $_REQUEST['timezone']) . '</p>';
37 if(x($a->data,'mod-localtime'))
38 $o .= '<p>' . sprintf( t('Converted localtime: %s'),$a->data['mod-localtime']) . '</p>';
41 $o .= '<form action ="' . System::baseUrl() . '/localtime?f=&time=' . $t . '" method="post" >';
43 $o .= '<p>' . t('Please select your timezone:') . '</p>';
45 $o .= select_timezone(($_REQUEST['timezone']) ? $_REQUEST['timezone'] : 'America/Los_Angeles');
47 $o .= '<input type="submit" name="submit" value="' . t('Submit') . '" /></form>';