Skip to content

Commit

Permalink
Update sdk/communication/azure-communication-chat/azure/communication…
Browse files Browse the repository at this point in the history
…/chat/_shared/utils.py

Co-authored-by: Rajarshi Sarkar <73562869+sarkar-rajarshi@users.noreply.github.com>
  • Loading branch information
Leoaqr and sarkar-rajarshi authored Apr 14, 2021
1 parent e544317 commit c56ea6b
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@
from msrest.serialization import TZ_UTC
from azure.core.credentials import AccessToken

"""
Converts DateTime in local time to the Epoch in UTC in second.
:param input_datetime: Input datetime
:type input_datetime: datetime
:return: Integer
:rtype: int
"""
def _convert_datetime_to_utc_int(expires_on):
offset_from_utc = time.localtime().tm_gmtoff
return time.mktime(input_datetime.timetuple()) + offset_from_utc
Expand Down

0 comments on commit c56ea6b

Please sign in to comment.