Skip to content

Commit 65a65ed

Browse files
authored
Merge pull request #118580 from viktormaruna/patch-4
Update event-hubs-capture-python.md
2 parents b7858d4 + 2a12c57 commit 65a65ed

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

articles/event-hubs/event-hubs-capture-python.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ In this section, you create a Python script that sends 200 events (10 devices *
7272
event_data_batch = producer.create_batch() # Create a batch. You will add events to the batch later.
7373
for dev in devices:
7474
# 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)}
75+
reading = {'id': dev, 'timestamp': str(datetime.datetime.now(datetime.UTC)), 'uv': random.random(), 'temperature': random.randint(70, 100), 'humidity': random.randint(70, 100)}
7676
s = json.dumps(reading) # Convert the reading into a JSON string.
7777
event_data_batch.add(EventData(s)) # Add event data to the batch.
7878
producer.send_batch(event_data_batch) # Send the batch of events to the event hub.

0 commit comments

Comments
 (0)