5 require_once('include/datetime.php');
7 function localtime_post(App $a) {
9 $t = $_REQUEST['time'];
13 $bd_format = t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8 AM
15 if($_POST['timezone'])
16 $a->data['mod-localtime'] = datetime_convert('UTC',$_POST['timezone'],$t,$bd_format);
20 function localtime_content(App $a) {
21 $t = $_REQUEST['time'];
25 $o .= '<h3>' . t('Time Conversion') . '</h3>';
27 $o .= '<p>' . t('Friendica provides this service for sharing events with other networks and friends in unknown timezones.') . '</p>';
31 $o .= '<p>' . sprintf( t('UTC time: %s'), $t) . '</p>';
33 if($_REQUEST['timezone'])
34 $o .= '<p>' . sprintf( t('Current timezone: %s'), $_REQUEST['timezone']) . '</p>';
36 if(x($a->data,'mod-localtime'))
37 $o .= '<p>' . sprintf( t('Converted localtime: %s'),$a->data['mod-localtime']) . '</p>';
40 $o .= '<form action ="' . App::get_baseurl() . '/localtime?f=&time=' . $t . '" method="post" >';
42 $o .= '<p>' . t('Please select your timezone:') . '</p>';
44 $o .= select_timezone(($_REQUEST['timezone']) ? $_REQUEST['timezone'] : 'America/Los_Angeles');
46 $o .= '<input type="submit" name="submit" value="' . t('Submit') . '" /></form>';