• Hi, Mike,

    I am organising an international online event with scheduled meetings, for example (times in server time: UCT)

    10:00 1/8/23 Meeting 1
    12:00 1/8/23 Meeting 2

    But if the user was in London (UCT+1) I want the times on the page to be adjusted accordingly. Eg

    11:00 1/8/23 Meeting 1
    13:00 1/8/23 Meeting 2

    I appreciate that this isn’t quite what your plugin does, but I wondered if you could offer any suggestions on how I can achieve this. It feels like it should be possible, but I can’t see how to do it, and I have not found any plugins that come close – yours seems to be the nearest.

    I tried to contact you via your website, but the name and email address fields on your contact form are read-only.

    Thanks for any help you (or anyone else) can offer.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author drmikegreen

    (@drmikegreen)

    I would think that some sort of meeting scheduler plugin would do this.

    I believe Google Calendar automatically does this. E.g., If you create a Google Calendar event, then share that calendar with someone else in a different time zone it will show the event time the way you wish.

    There is, I believe, a plugin called something like Events Calendar. I would think that it should do what you want.

    Thanks for reporting the problem with the form on my website. I’ll have to fix that.

    Thread Starter anotheruserhere

    (@anotheruserhere)

    Hi,

    Thanks for your prompt response. 

    I think I have found a solution using a short code to take a date string (with a specified TZ) and redisplay it using the current TZ (using your plugin to set the client TZ).

    However, I got someone in Chicago to test it but they saw the time as GMT not CST as I’d have expected. If I test it here I get ‘Europe/London’ as TZ using Arc Browser but ‘GMT’ using Safari. My Chicago friend also uses a Mac so I’m wondering if it’s Safari not passing on the info you need. Is this something you have experienced?

    I have a test page at https://encounterevents.uk/test-page/ and wonder what time you see.

    Plugin Author drmikegreen

    (@drmikegreen)

    I see ‘This event is at “11:00 AM 1/6/23 CST” or 5:00 PM, 6 Jan 2023 (GMT)’ at the link you posted. (My time zone is EDT.)

    JavaScript must be working in the browser. I have, however, not tested using Safari. But I suspect it should work.

    Thread Starter anotheruserhere

    (@anotheruserhere)

    That’s very odd as it’s not picking up your TZ. Is there any way I can debug it or see what is happening?

    Plugin Author drmikegreen

    (@drmikegreen)

    If you are familiar with PHP, you could go to the use-clients-timezone-class.inc.php file and add output (echo) statements at appropriate places in the code.

    There is also the possibility that removing the comment out “//”s from all the places having to do with “uctz_use_for_admin” and the like would enable you to have a setting in the control panel which would make more information available. (I make this statement after a quick scan of the code. I wrote this more than a decade ago. So I’m no longer sure what those comment out-ed bits of code did. But I reckon I had them there for debugging.)

    If you’re not able to do this, I can see what I can find. It may, however, take me a few days to get to it.

    Thread Starter anotheruserhere

    (@anotheruserhere)

    I’m going to be away for the next two weeks and the code looks beyond my knowledge so if you can take a look I’d appreciate it. Once I’m back I can help debug as it seems to work for me in Arc Browser (displaying ‘Europe/London’ as my TZ) but not in Safari (displaying ‘GMT’, the server TZ).

    Plugin Author drmikegreen

    (@drmikegreen)

    I can’t find a way to duplicate your test and, therefore, how the Use Client’s Time Zone plugin can work with it.

    Thread Starter anotheruserhere

    (@anotheruserhere)

    Here is the code for my shortcode

    ‘/**

    • The [date] shortcode.
      *
    • Accepts a date and displays it with the current TZ
      *
    • @param array $atts Shortcode attributes. Default empty.
    • @param string $content Shortcode content. Default null.
    • @param string $tag Shortcode tag (name). Default empty.
    • @return string Shortcode output.
      */
      function date_shortcode( $atts = [], $content = null, $tag = ” ) {
      // override default attributes with user attributes
      $atts = shortcode_atts(
      array(
      ‘date’ => date(“h:i A d F Y”),
      ), $atts, $tag
      ); $date=$atts['date']; $o = '<span class="event-date">'.date("g:i A, j M Y (e)", strtotime("$date")).'</span>'; // $o= $o . "<br>Input date: $date";
    • return $o; }

    add_shortcode( ‘date’, ‘date_shortcode’ );’

    And the test page (implemented at https://encounterevents.uk/test-page/) is

    ‘This event is at “11:00 AM 1/6/23 CST” or [date date=”11:00 AM 1/6/23 CST” ]’

    I looked at the code and I can’t see why it’s not working as expected. I am wondering if the JS function you call isn’t working. I took a look at that, too, but it’s way beyond me. Or, of course, it could be (and perhaps more probably is) a bug in my code that I can’t see.

    Any help you can offer would be greatly appreciated. Thanks

    Plugin Author drmikegreen

    (@drmikegreen)

    It may take me a couple of days to sort this out, since the next few days are full of other tasks to be done. Sorry. ??

    Plugin Author drmikegreen

    (@drmikegreen)

    I cannot get your code for your shortcode to work. Perhaps you need to get someone else to diagnose this problem. Sorry. ??

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Displaying times according to user TZ’ is closed to new replies.