LoslegenKostenlos loslegen

Creating datetimes by hand

Often you create datetime objects based on outside data. Sometimes though, you want to create a datetime object from scratch.

You're going to create a few different datetime objects from scratch to get the hang of that process. These come from the bikeshare data set that you'll use throughout the rest of the chapter.

Diese Übung ist Teil des Kurses

Working with Dates and Times in Python

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Import datetime
from ____ import ____

# Create a datetime object
dt = datetime(____, ____, ____, ____, ____, ____)

# Print the results in ISO 8601 format
print(____)
Code bearbeiten und ausführen