Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.0 KiB

  1. <?php
  2. require_once('include/datetime.php');
  3. function localtime_post(&$a) {
  4. $t = $_REQUEST['time'];
  5. if(! $t)
  6. $t = 'now';
  7. $bd_format = t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8 AM
  8. if($_POST['timezone'])
  9. $a->data['mod-localtime'] = datetime_convert('UTC',$_POST['timezone'],$t,$bd_format);
  10. }
  11. function localtime_content(&$a) {
  12. $t = $_REQUEST['time'];
  13. if(! $t)
  14. $t = 'now';
  15. $o .= '<h3>' . t('Time Conversion') . '</h3>';
  16. $o .= '<p>' . t('Friendika provides this service for sharing events with other networks and friends in unknown timezones.') . '</p>';
  17. if(x($a->data,'mod-localtime'))
  18. $o .= '<p>' . sprintf( t('Converted localtime: %s'),$a->data['mod-localtime']) . '</p>';
  19. $o .= '<p>' . sprintf( t('UTC time: %s'), $t) . '</p>';
  20. $o .= '<form action ="' . $a->get_baseurl() . '/localtime?f=&time=' . $t . '" method="post" >';
  21. $o .= '<p>' . t('Please select your timezone:') . '</p>';
  22. $o .= select_timezone();
  23. $o .= '<input type="submit" name="submit" value="' . t('Submit') . '" /></form>';
  24. return $o;
  25. }