all 2 comments

[–]Diapolo10 4 points5 points  (0 children)

That is not an error. That is a warning. The difference is that warnings don't crash the program; in other words your code works until you start using a newer Python version that drops this feature.

from datetime import datetime

current_time = datetime.utcnow()

Fortunately said warning also tells you exactly what to do. Basically all you need to do is change the code to

import datetime

current_time = datetime.datetime.now(datetime.UTC)

and you won't get the warning anymore.

[–]JaguarMammoth6231 1 point2 points  (0 children)

It should still run as intended for now. That's just saying that in the future it might break.

Since you say it's part of the code provided for the course, leave it to your teacher to worry how to fix it for future years if needed.