# Help to stop time syncing

**URL:** <https://devforum.zoom.us/t/help-to-stop-time-syncing/41086>\
**Category:** Web\
**Created:** [January 20, 2021, 1:35pm UTC](https://devforum.zoom.us/t/help-to-stop-time-syncing/41086 "2021-01-20T13:35:32Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dipapatra2012](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dipapatra2012/32/17661_2.png) [@dipapatra2012](https://devforum.zoom.us/u/dipapatra2012)\
**Post date:** [January 20, 2021, 1:35pm UTC](https://devforum.zoom.us/t/help-to-stop-time-syncing/41086/1 "2021-01-20T13:35:32Z")

</div>

**Description**  
If my server time is not matching exactly with the current time then Web SDK is not allowing to join a meeting. If the difference is of minute then also having an issue.

Can you please me to stop comparing time zone/ time by anyway?

**Which version?**  
1.8.6

---

<div class="post-metadata">

**Author:** ![alexmayo](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/alexmayo/32/27289_2.png) [@alexmayo](https://devforum.zoom.us/u/alexmayo)\
**Post date:** [January 20, 2021, 2:31pm UTC](https://devforum.zoom.us/t/help-to-stop-time-syncing/41086/2 "2021-01-20T14:31:18Z")

</div>

Hi @dipapatra2012,

I believe your server needs to use the correct time, since the signature would be out of date otherwise.

Thanks,  
Alex

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [January 20, 2021, 10:56pm UTC](https://devforum.zoom.us/t/help-to-stop-time-syncing/41086/3 "2021-01-20T22:56:59Z")

</div>

Hey @dipapatra2012,

Thank you for reaching out. @alexmayo is correct, you will need to make sure that your server is synced with the UTC timezone in order to avoid signature expiration issues.

Let me know if you have any questions.

Thanks,  
Max

---

<div class="post-metadata">

**Author:** ![dipapatra2012](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dipapatra2012/32/17661_2.png) [@dipapatra2012](https://devforum.zoom.us/u/dipapatra2012)\
**Post date:** [January 23, 2021, 11:59am UTC](https://devforum.zoom.us/t/help-to-stop-time-syncing/41086/4 "2021-01-23T11:59:12Z")

</div>

@MaxM Is there anyway to make it working even though the server isn’t in sync?

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [January 25, 2021, 5:21pm UTC](https://devforum.zoom.us/t/help-to-stop-time-syncing/41086/5 "2021-01-25T17:21:58Z")

</div>

Hey @dipapatra2012 ,

Is your server not in UTC time?

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![alexmayo](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/alexmayo/32/27289_2.png) [@alexmayo](https://devforum.zoom.us/u/alexmayo)\
**Post date:** [February 1, 2021, 10:33am UTC](https://devforum.zoom.us/t/help-to-stop-time-syncing/41086/6 "2021-02-01T10:33:24Z")

</div>

The Zoom signature uses UTC as a timestamp origin, therefore if you’re running another timezone, PHP’s `time()` function will return an incorrect time.

You can get around this using the `date_default_timezone_set()` function, which sets the timezone for the remainder of the PHP script.

```auto
function generate_signature ( $api_key, $api_secret, $meeting_number, $role){

    //Set the timezone to UTC
    date_default_timezone_set("UTC");

    //Time in milliseconds (or close enough)
    $time = time() * 1000 - 30000;
	
    $data = base64_encode($api_key . $meeting_number . $time . $role);
	
    $hash = hash_hmac('sha256', $data, $api_secret, true);
	
    $_sig = $api_key . "." . $meeting_number . "." . $time . "." . $role . "." . base64_encode($hash);
	
    // Return signature, url safe base64 encoded
    return rtrim(strtr(base64_encode($_sig), '+/', '-_'), '=');
}

```

@tommy, I’m wondering it it’s worth adding the `date_default_timezone_set("UTC");` line to the documentation, in case anyone else’s server doesn’t run on UTC. Having looked at my server, I’m actually running on ‘Europe/London’ time, meaning that for half the year, my signatures will be 60 minutes out, so I’l be adding this to my implementation too!

Cheers,  
Alex

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [February 1, 2021, 11:00pm UTC](https://devforum.zoom.us/t/help-to-stop-time-syncing/41086/7 "2021-02-01T23:00:16Z")

</div>

Hey @alexmayo,

I think that’s a great suggestion! @shrijana.g would you be able to add the following line to the [Generate a Signature](https://marketplace.zoom.us/docs/sdk/native-sdks/web/build/signature#generate-signature) PHP example?

```php
date_default_timezone_set("UTC");

```

This will help developers to ensure that the time they are using the correct timezone.

Thanks,  
Max

---

<div class="post-metadata">

**Author:** ![shrijana.g](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shrijana.g/32/605_2.png) [@shrijana.g](https://devforum.zoom.us/u/shrijana.g)\
**Post date:** [February 11, 2021, 6:02pm UTC](https://devforum.zoom.us/t/help-to-stop-time-syncing/41086/8 "2021-02-11T18:02:51Z")

</div>

@alexmayo Thanks for sharing this with us. @MaxM This has been added to the PHP example. 🙂

Thanks,  
Shrijana

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [March 14, 2021, 4:03am UTC](https://devforum.zoom.us/t/help-to-stop-time-syncing/41086/9 "2021-03-14T04:03:05Z")

</div>

Closed on March 14, 2021, 4:03am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
