We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b7858d4 + 2a12c57 commit 65a65edCopy full SHA for 65a65ed
1 file changed
articles/event-hubs/event-hubs-capture-python.md
@@ -72,7 +72,7 @@ In this section, you create a Python script that sends 200 events (10 devices *
72
event_data_batch = producer.create_batch() # Create a batch. You will add events to the batch later.
73
for dev in devices:
74
# Create a dummy reading.
75
- reading = {'id': dev, 'timestamp': str(datetime.datetime.utcnow()), 'uv': random.random(), 'temperature': random.randint(70, 100), 'humidity': random.randint(70, 100)}
+ reading = {'id': dev, 'timestamp': str(datetime.datetime.now(datetime.UTC)), 'uv': random.random(), 'temperature': random.randint(70, 100), 'humidity': random.randint(70, 100)}
76
s = json.dumps(reading) # Convert the reading into a JSON string.
77
event_data_batch.add(EventData(s)) # Add event data to the batch.
78
producer.send_batch(event_data_batch) # Send the batch of events to the event hub.
0 commit comments