diff --git a/sdk/communication/azure-communication-sms/azure/communication/sms/_sms_client.py b/sdk/communication/azure-communication-sms/azure/communication/sms/_sms_client.py index 7ee29a39d2c6..7f2976e5dd2c 100644 --- a/sdk/communication/azure-communication-sms/azure/communication/sms/_sms_client.py +++ b/sdk/communication/azure-communication-sms/azure/communication/sms/_sms_client.py @@ -5,7 +5,6 @@ # -------------------------------------------------------------------------- from uuid import uuid4 -from datetime import datetime from azure.core.tracing.decorator import distributed_trace from azure.communication.sms._generated.models import ( SendMessageRequest, @@ -15,7 +14,7 @@ from azure.communication.sms._models import SmsSendResult from ._generated._azure_communication_sms_service import AzureCommunicationSMSService -from ._shared.utils import parse_connection_str, get_authentication_policy +from ._shared.utils import parse_connection_str, get_authentication_policy, get_current_utc_time from ._version import SDK_MONIKER class SmsClient(object): @@ -113,7 +112,7 @@ def send(self, from_, # type: str SmsRecipient( to=p, repeatability_request_id=str(uuid4()), - repeatability_first_sent=datetime.utcnow() + repeatability_first_sent=get_current_utc_time() ) for p in to ], message=message, diff --git a/sdk/communication/azure-communication-sms/azure/communication/sms/aio/_sms_client_async.py b/sdk/communication/azure-communication-sms/azure/communication/sms/aio/_sms_client_async.py index 30c1ab7c789f..920519a343b7 100644 --- a/sdk/communication/azure-communication-sms/azure/communication/sms/aio/_sms_client_async.py +++ b/sdk/communication/azure-communication-sms/azure/communication/sms/aio/_sms_client_async.py @@ -5,7 +5,6 @@ # -------------------------------------------------------------------------- from uuid import uuid4 -from datetime import datetime from azure.core.tracing.decorator_async import distributed_trace_async from azure.communication.sms._generated.models import ( SendMessageRequest, @@ -15,7 +14,7 @@ from azure.communication.sms._models import SmsSendResult from .._generated.aio._azure_communication_sms_service import AzureCommunicationSMSService -from .._shared.utils import parse_connection_str, get_authentication_policy +from .._shared.utils import parse_connection_str, get_authentication_policy, get_current_utc_time from .._version import SDK_MONIKER class SmsClient(object): @@ -114,7 +113,7 @@ async def send(self, from_, # type: str SmsRecipient( to=p, repeatability_request_id=str(uuid4()), - repeatability_first_sent=datetime.utcnow() + repeatability_first_sent=get_current_utc_time() ) for p in to ], message=message,